[JS IR BE] Support enumValues<T>() and enumValueOf<T>(name)

This commit is contained in:
Svyatoslav Kuzmich
2018-10-01 15:51:52 +03:00
parent bdc3daf972
commit 7074909230
28 changed files with 122 additions and 27 deletions
+18
View File
@@ -0,0 +1,18 @@
// EXPECTED_REACHABLE_NODES: 1555
package foo
enum class EmptyEnum
enum class A {
a() {
},
b(),
c
}
fun box(): String {
if (enumValues<EmptyEnum>().size != 0) return "enumValues<EmptyEnum>().size != 0"
if (enumValues<A>().asList() != listOf(A.a, A.b, A.c)) return "Wrong enumValues<A>(): " + enumValues<A>().toString()
if (enumValueOf<A>("b") != A.b) return "enumValueOf<A>('b') != A.b"
return "OK"
}