Skip to content

Commit dfe47b0

Browse files
Blaisorbladeallanrenucci
authored andcommitted
Simplify fix
1 parent 66c96a1 commit dfe47b0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,24 +2015,20 @@ object Parsers {
20152015
/** ImportSelector ::= id [`=>' id | `=>' `_']
20162016
*/
20172017
def importSelector(): Tree = {
2018-
val start = in.offset
20192018
val from = termIdentOrWildcard()
20202019
if (from.name != nme.WILDCARD && in.token == ARROW)
20212020
atPos(startOffset(from), in.skipToken()) {
2022-
val start2 = in.offset
2021+
val start = in.offset
20232022
val to = termIdentOrWildcard()
20242023
val toWithPos =
20252024
if (to.name == nme.ERROR)
20262025
// error identifiers don't consume any characters, so atPos(start)(id) wouldn't set a position.
20272026
// Some testcases would then fail in Positioned.checkPos. Set a position anyway!
2028-
atPos(start2, start2, in.lastOffset)(to)
2027+
atPos(start, start, in.lastOffset)(to)
20292028
else
20302029
to
20312030
Thicket(from, toWithPos)
20322031
}
2033-
else if (from.name == nme.ERROR) {
2034-
atPos(start, start, in.lastOffset)(from)
2035-
}
20362032
else from
20372033
}
20382034

0 commit comments

Comments
 (0)