File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,9 @@ object Scanners {
186186 error(s " illegal combination of -rewrite targets: ${enabled(0 ).name} and ${enabled(1 ).name}" )
187187 }
188188
189- var languageImportContext : Context = ctx
189+ private var myLanguageImportContext : Context = ctx
190+ def languageImportContext = myLanguageImportContext
191+ final def languageImportContext_= (c : Context ) = myLanguageImportContext = c
190192
191193 def featureEnabled (name : TermName ) = Feature .enabled(name)(using languageImportContext)
192194 def erasedEnabled = featureEnabled(Feature .erasedTerms) || ctx.settings.YerasedTerms .value
@@ -912,7 +914,9 @@ object Scanners {
912914 reset()
913915 next
914916
915- class LookaheadScanner () extends Scanner (source, offset)
917+ class LookaheadScanner () extends Scanner (source, offset) {
918+ override def languageImportContext = Scanner .this .languageImportContext
919+ }
916920
917921 /** Skip matching pairs of `(...)` or `[...]` parentheses.
918922 * @pre The current token is `(` or `[`
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ object Tokens extends TokensCommon {
248248
249249 final val modifierTokensOrCase : TokenSet = modifierTokens | BitSet (CASE )
250250
251- final val modifierFollowers = modifierTokens | defIntroTokens
251+ final val modifierFollowers = modifierTokensOrCase | defIntroTokens
252252
253253 /** Is token only legal as start of statement (eof also included)? */
254254 final val mustStartStatTokens : TokenSet = defIntroTokens | modifierTokens | BitSet (IMPORT , EXPORT , PACKAGE )
Original file line number Diff line number Diff line change @@ -29,6 +29,6 @@ enum Foo11 {
2929 protected case C9 // ok
3030}
3131
32- enum Foo12 { // error: enums must contain at least one case
33- inline case C10 () // error // error (inline treated as ident here)
32+ enum Foo12 {
33+ inline case C10 () // error: only access modifiers allowed
3434}
You can’t perform that action at this time.
0 commit comments