Skip to content

Commit

Permalink
Remove extra if
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Oct 18, 2024
1 parent 634d9b7 commit 3a98a1c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4696,9 +4696,11 @@ object Parsers {
stats += closure(in.offset, Location.InBlock, modifiers(BitSet(IMPLICIT)))
else if isIdent(nme.extension) && followingIsExtension() then
stats += extension()
else if outermost && ctx.mode.is(Mode.Interactive) && isDefIntro(localModifierTokens) then
stats +++= localDef(in.offset)
else if isDefIntro(localModifierTokens, excludedSoftModifiers = Set(nme.`opaque`)) then
else if isDefIntro(localModifierTokens,
excludedSoftModifiers =
// Allow opaque definitions at outermost level in REPL.
if outermost && ctx.mode.is(Mode.Interactive)
then Set.empty else Set(nme.`opaque`)) then
stats +++= localDef(in.offset)
else
empty = true
Expand Down

0 comments on commit 3a98a1c

Please sign in to comment.