File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2018,7 +2018,16 @@ object Parsers {
20182018 val from = termIdentOrWildcard()
20192019 if (from.name != nme.WILDCARD && in.token == ARROW )
20202020 atPos(startOffset(from), in.skipToken()) {
2021- Thicket (from, termIdentOrWildcard())
2021+ val start = in.offset
2022+ val to = termIdentOrWildcard()
2023+ val toWithPos =
2024+ if (to.name == nme.ERROR )
2025+ // error identifiers don't consume any characters, so atPos(start)(id) wouldn't set a position.
2026+ // Some testcases would then fail in Positioned.checkPos. Set a position anyway!
2027+ atPos(start, start, in.lastOffset)(to)
2028+ else
2029+ to
2030+ Thicket (from, toWithPos)
20222031 }
20232032 else from
20242033 }
Original file line number Diff line number Diff line change 1+ object i0 {
2+ import Ordering .{ implicitly => } (true: Boolean ) match { case _: i1 => true } // error // error
3+ }
You can’t perform that action at this time.
0 commit comments