diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index 5da8db6a91c8..61e31ff1dce8 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -612,6 +612,7 @@ object Scanners { prev.copyFrom(this) lastOffset = lastCharOffset fetchToken() + if token == END && !isEndMarker then token = IDENTIFIER } def reset() = { diff --git a/tests/pos/i13134.scala b/tests/pos/i13134.scala new file mode 100644 index 000000000000..d3b70d389dcf --- /dev/null +++ b/tests/pos/i13134.scala @@ -0,0 +1,10 @@ +def test = + { + val end = 0 + assert(~end == -1) //Not found: ~ + } + + { + val end = false + assert(!end) // postfix operator `end` needs to be enabled + } // by making the implicit value scala.language.postfixOps visible. \ No newline at end of file