Closed
Description
minimized code
class A {}
@FunctionalInterface class B
Compilation output
-- Error: f1.scala:2:0 ---------------------------------------------------------
2 |@FunctionalInterface class B
|^
|end of statement expected but '@' found
1 error found
expectation
Compiles cleanly. Dropping the space fixes it. Or declaring it's in a package.
You can use any annotation.
Without the curly brackets the errors are on later parts:
class A
@FunctionalInterface class B
-- Error: f3.scala:2:21 --------------------------------------------------------
2 |@FunctionalInterface class B
| ^^^^^
| end of statement expected but 'class' found
-- [E040] Syntax Error: f3.scala:2:27 ------------------------------------------
2 |@FunctionalInterface class B
| ^
| ';' expected, but identifier found
2 errors found
Using HEAD of master:
$ dotc -version
Dotty compiler version 0.24.0-bin-SNAPSHOT-git-68e2023 -- Copyright 2002-2020, LAMP/EPFL