Skip to content

Commit 78afe8a

Browse files
committed
Simplify fix
1 parent 83610bb commit 78afe8a

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
@@ -1975,24 +1975,20 @@ object Parsers {
19751975
/** ImportSelector ::= id [`=>' id | `=>' `_']
19761976
*/
19771977
def importSelector(): Tree = {
1978-
val start = in.offset
19791978
val from = termIdentOrWildcard()
19801979
if (from.name != nme.WILDCARD && in.token == ARROW)
19811980
atPos(startOffset(from), in.skipToken()) {
1982-
val start2 = in.offset
1981+
val start = in.offset
19831982
val to = termIdentOrWildcard()
19841983
val toWithPos =
19851984
if (to.name == nme.ERROR)
19861985
// error identifiers don't consume any characters, so atPos(start)(id) wouldn't set a position.
19871986
// Some testcases would then fail in Positioned.checkPos. Set a position anyway!
1988-
atPos(start2, start2, in.lastOffset)(to)
1987+
atPos(start, start, in.lastOffset)(to)
19891988
else
19901989
to
19911990
Thicket(from, toWithPos)
19921991
}
1993-
else if (from.name == nme.ERROR) {
1994-
atPos(start, start, in.lastOffset)(from)
1995-
}
19961992
else from
19971993
}
19981994

0 commit comments

Comments
 (0)