Create classes when deserializing enum entries

This commit is contained in:
Alexander Udalov
2013-11-13 23:38:27 +04:00
parent bd5eee5cc2
commit dd290bbeb9
11 changed files with 195 additions and 53 deletions
@@ -0,0 +1,6 @@
package aaa
enum class E {
TRIVIAL_ENTRY
SUBCLASS { }
}
@@ -0,0 +1,5 @@
import aaa.E
fun main(args: Array<String>) {
if (E.TRIVIAL_ENTRY == E.SUBCLASS) throw AssertionError()
}
@@ -0,0 +1,10 @@
package aaa
enum class E {
TRIVIAL_ENTRY
SUBCLASS { }
class Nested {
fun fortyTwo() = 42
}
}
@@ -0,0 +1,6 @@
import aaa.E.*
fun main(args: Array<String>) {
if (TRIVIAL_ENTRY == SUBCLASS) throw AssertionError()
if (Nested().fortyTwo() != 42) throw AssertionError()
}