mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
21 lines
494 B
Kotlin
Vendored
21 lines
494 B
Kotlin
Vendored
//ALLOW_AST_ACCESS
|
|
package test
|
|
|
|
// This test checks that we don't accidentally call toString() on an enum value
|
|
// to determine which enum entry appears in the annotation, and call name() instead
|
|
|
|
enum class E {
|
|
CAKE {
|
|
override fun toString() = "LIE"
|
|
}
|
|
}
|
|
|
|
annotation class EnumAnno(val value: E)
|
|
annotation class EnumArrayAnno(vararg val value: E)
|
|
|
|
public class EnumArgumentWithCustomToString {
|
|
@EnumAnno(E.CAKE)
|
|
@EnumArrayAnno(E.CAKE, E.CAKE)
|
|
fun annotated() {}
|
|
}
|