Closed
Description
The following code snippet fails to compile under Scala2 mode:
class Foo {
inline def foo = 1
}
dotc Foo.scala -language:Scala2
-- [E040] Syntax Error: Foo.scala:41:13 ---------------------------
41 | inline def foo = 1
| ^^^
| ';' expected, but identifier found
-- [E006] Unbound Identifier Error: Foo.scala:41:2 ----------------
41 | inline def foo = 1
| ^^^^^^
| not found: inline
The issue is that the scanner treats the inline
keyword as an ident under Scala2 mode.