File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4684,7 +4684,7 @@ object Parsers {
4684
4684
* | Expr1
4685
4685
* |
4686
4686
*/
4687
- def blockStatSeq (): List [Tree ] = checkNoEscapingPlaceholders {
4687
+ def blockStatSeq (outermost : Boolean = false ): List [Tree ] = checkNoEscapingPlaceholders {
4688
4688
val stats = new ListBuffer [Tree ]
4689
4689
while
4690
4690
var empty = false
@@ -4696,7 +4696,7 @@ 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 ctx.mode.is(Mode .Interactive ) && isDefIntro(localModifierTokens) then
4699
+ else if outermost && ctx.mode.is(Mode .Interactive ) && isDefIntro(localModifierTokens) then
4700
4700
stats +++= localDef(in.offset)
4701
4701
else if isDefIntro(localModifierTokens, excludedSoftModifiers = Set (nme.`opaque`)) then
4702
4702
stats +++= localDef(in.offset)
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ object ParseResult {
122
122
123
123
private def parseStats (using Context ): List [untpd.Tree ] = {
124
124
val parser = new Parser (ctx.source)
125
- val stats = parser.blockStatSeq()
125
+ val stats = parser.blockStatSeq(outermost = true )
126
126
parser.accept(Tokens .EOF )
127
127
stats
128
128
}
You can’t perform that action at this time.
0 commit comments