Closed
Description
Compiler version
3.0.0-RC2-bin-20210317-758782a-NIGHTLY
Minimized code
object SoftModifierTests {
def main(args: Array[String]): Unit = {
def inline(): Unit = println("do some work...")
inline()
}
}
Output
Error
`inline` must be followed by an `if` or a `match`
inline()
Expectation
According to the spec https://dotty.epfl.ch/docs/reference/soft-modifier.html inline should be treated as a normal identifier:
- it's not followed by
if
ormatch
- it's not followed by parameter definition
- it's not followed by hard modifier
- it's not followed by
class
,trait
, etc... -
Everywhere else a soft keyword is treated as a normal identifier
and the code should compile