File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2313,6 +2313,11 @@ object Parsers {
2313
2313
def enumCase (start : Offset , mods : Modifiers ): DefTree = {
2314
2314
val mods1 = mods.withAddedMod(atPos(in.offset)(Mod .EnumCase ())) | Case
2315
2315
accept(CASE )
2316
+
2317
+ in.adjustSepRegions(ARROW )
2318
+ // Scanner thinks it is in a pattern match after seeing the `case`.
2319
+ // We need to get it out of that mode by telling it we are past the `=>`
2320
+
2316
2321
atPos(start, nameStart) {
2317
2322
val id = termIdent()
2318
2323
if (in.token == LBRACKET || in.token == LPAREN )
Original file line number Diff line number Diff line change
1
+ enum Foo {
2
+ case A
3
+ private case B
4
+ @ deprecated(" Will be removed" ) case C
5
+ @ deprecated(" Will be removed" ) private case D
6
+ }
Original file line number Diff line number Diff line change
1
+ enum class Ducks
2
+
3
+ object Ducks {
4
+ case Dewey
5
+
6
+ def wooohoo : Int = 1
7
+ }
You can’t perform that action at this time.
0 commit comments