File tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/parsing
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4696,9 +4696,11 @@ object Parsers {
4696
4696
stats += closure(in.offset, Location .InBlock , modifiers(BitSet (IMPLICIT )))
4697
4697
else if isIdent(nme.extension) && followingIsExtension() then
4698
4698
stats += extension()
4699
- else if outermost && ctx.mode.is(Mode .Interactive ) && isDefIntro(localModifierTokens) then
4700
- stats +++= localDef(in.offset)
4701
- else if isDefIntro(localModifierTokens, excludedSoftModifiers = Set (nme.`opaque`)) then
4699
+ else if isDefIntro(localModifierTokens,
4700
+ excludedSoftModifiers =
4701
+ // Allow opaque definitions at outermost level in REPL.
4702
+ if outermost && ctx.mode.is(Mode .Interactive )
4703
+ then Set .empty else Set (nme.`opaque`)) then
4702
4704
stats +++= localDef(in.offset)
4703
4705
else
4704
4706
empty = true
You can’t perform that action at this time.
0 commit comments