Skip to content

Commit 3a98a1c

Browse files
committed
Remove extra if
1 parent 634d9b7 commit 3a98a1c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+5-3
Original file line numberDiff line numberDiff line change
@@ -4696,9 +4696,11 @@ object Parsers {
46964696
stats += closure(in.offset, Location.InBlock, modifiers(BitSet(IMPLICIT)))
46974697
else if isIdent(nme.extension) && followingIsExtension() then
46984698
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
47024704
stats +++= localDef(in.offset)
47034705
else
47044706
empty = true

0 commit comments

Comments
 (0)