Skip to content

Commit 6182b2c

Browse files
Blaisorbladeallanrenucci
authored andcommitted
Revert parts of "Prevent position errors on Ident(nme.ERROR)"
This reverts commit 0f7b1b0 but keeps the testcase.
1 parent d9bf41c commit 6182b2c

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
@@ -526,16 +526,8 @@ object Parsers {
526526
}
527527

528528
/** Accept identifier and return Ident with its name as a term name. */
529-
def termIdent(): Ident = {
530-
val start = in.offset
531-
val id = makeIdent(in.token, ident())
532-
if (id.name != nme.ERROR) {
533-
atPos(start)(id)
534-
} else {
535-
// error identifiers don't consume any characters, so atPos(start)(id) wouldn't set a position.
536-
// Some testcases would then fail in Positioned.checkPos. Set a position anyway!
537-
atPos(start, start, in.lastOffset)(id)
538-
}
529+
def termIdent(): Ident = atPos(in.offset) {
530+
makeIdent(in.token, ident())
539531
}
540532

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

0 commit comments

Comments
 (0)