File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2813,13 +2813,14 @@ object Parsers {
28132813 def modifiers (allowed : BitSet = modifierTokens, start : Modifiers = Modifiers ()): Modifiers = {
28142814 @ tailrec
28152815 def loop (mods : Modifiers ): Modifiers =
2816- if (allowed.contains(in.token) ||
2817- in.isSoftModifier &&
2818- localModifierTokens.subsetOf(allowed)) { // soft modifiers are admissible everywhere local modifiers are
2816+ if allowed.contains(in.token)
2817+ || in.isSoftModifier
2818+ && localModifierTokens.subsetOf(allowed) // soft modifiers are admissible everywhere local modifiers are
2819+ && in.lookahead.token != COLON
2820+ then
28192821 val isAccessMod = accessModifierTokens contains in.token
28202822 val mods1 = addModifier(mods)
28212823 loop(if (isAccessMod) accessQualifierOpt(mods1) else mods1)
2822- }
28232824 else if (in.token == NEWLINE && (mods.hasFlags || mods.hasAnnotations)) {
28242825 in.nextToken()
28252826 loop(mods)
Original file line number Diff line number Diff line change 1+ class C (inline : String )
You can’t perform that action at this time.
0 commit comments