Skip to content

Commit 8845080

Browse files
noti0na1tgodzik
authored andcommitted
Remove extra if
[Cherry-picked 3a98a1c]
1 parent 0059f14 commit 8845080

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4389,9 +4389,11 @@ object Parsers {
43894389
stats += closure(in.offset, Location.InBlock, modifiers(BitSet(IMPLICIT)))
43904390
else if isIdent(nme.extension) && followingIsExtension() then
43914391
stats += extension()
4392-
else if outermost && ctx.mode.is(Mode.Interactive) && isDefIntro(localModifierTokens) then
4393-
stats +++= localDef(in.offset)
4394-
else if isDefIntro(localModifierTokens, excludedSoftModifiers = Set(nme.`opaque`)) then
4392+
else if isDefIntro(localModifierTokens,
4393+
excludedSoftModifiers =
4394+
// Allow opaque definitions at outermost level in REPL.
4395+
if outermost && ctx.mode.is(Mode.Interactive)
4396+
then Set.empty else Set(nme.`opaque`)) then
43954397
stats +++= localDef(in.offset)
43964398
else
43974399
empty = true

0 commit comments

Comments
 (0)