Skip to content

Commit ad04880

Browse files
committed
Revert parts of "Prevent position errors on Ident(nme.ERROR)"
This reverts commit 0f7b1b0 but keeps the testcase.
1 parent 3c8545b commit ad04880

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,8 @@ object Parsers {
518518
}
519519

520520
/** Accept identifier and return Ident with its name as a term name. */
521-
def termIdent(): Ident = {
522-
val start = in.offset
523-
val id = makeIdent(in.token, ident())
524-
if (id.name != nme.ERROR) {
525-
atPos(start)(id)
526-
} else {
527-
// error identifiers don't consume any characters, so atPos(start)(id) wouldn't set a position.
528-
// Some testcases would then fail in Positioned.checkPos. Set a position anyway!
529-
atPos(start, start, in.lastOffset)(id)
530-
}
521+
def termIdent(): Ident = atPos(in.offset) {
522+
makeIdent(in.token, ident())
531523
}
532524

533525
/** Accept identifier and return Ident with its name as a type name. */

0 commit comments

Comments
 (0)