Fix deserialization of enum annotation arguments at runtime

This commit is contained in:
Alexander Udalov
2015-02-27 17:22:02 +03:00
parent f36ef6f546
commit 4fb420f3f1
12 changed files with 177 additions and 13 deletions
@@ -0,0 +1,20 @@
//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() {}
}