File tree 2 files changed +13
-1
lines changed
compiler/src/dotty/tools/dotc/parsing
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2018,7 +2018,16 @@ object Parsers {
2018
2018
val from = termIdentOrWildcard()
2019
2019
if (from.name != nme.WILDCARD && in.token == ARROW )
2020
2020
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)
2022
2031
}
2023
2032
else from
2024
2033
}
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