- Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Compiler version
3.5.2
Minimized code
class C: final val Seconds = java.util.concurrent.TimeUnit.SECONDS //inline val SecondSeconds = java.util.concurrent.TimeUnit.SECONDS // not a literal @OutputTimeUnit(Seconds) def f(): Unit = () @OutputTimeUnit(java.util.concurrent.TimeUnit.SECONDS) def ok(): Unit = ()
where
import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.util.concurrent.TimeUnit; @Inherited @Target({ElementType.METHOD,ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface OutputTimeUnit { /** * @return Time unit to use. */ TimeUnit value(); }
Output
7 | @OutputTimeUnit(Seconds) | ^^^^^^^ | Annotation argument is not a constant
Expectation
Works as in Scala 2.
Spec says platform enum is a constant value expression; Seconds
is a constant value definition.