Closed
Description
Compiler version
3.0.0-RC1
and 3.0.0-RC2-bin-20210219-aa7c21e-NIGHTLY
Minimized code
- https://github.com/xuwei-k/TYPE_USE-annotation-scala3/actions/runs/585539595
- xuwei-k/TYPE_USE-annotation-scala3@d408ed3
A.java
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.util.List;
@Target({ TYPE_USE })
@Retention(RUNTIME)
@interface NotNull {}
interface A {
public List<@NotNull String> x();
}
B.scala
class B
Output
[error] -- Error: /home/runner/work/TYPE_USE-annotation-scala3/TYPE_USE-annotation-scala3/src/main/scala/A.java:12:14
[error] 12 | public List<@NotNull String> x();
[error] | ^^^^
[error] | illegal start of type
[error] -- Error: /home/runner/work/TYPE_USE-annotation-scala3/TYPE_USE-annotation-scala3/src/main/scala/A.java:12:34
[error] 12 | public List<@NotNull String> x();
[error] | ^
[error] | null expected but ';' found.
[error] two errors found
Expectation
success compile
Note
success with Scala 2.13.4, 2.12.13