Create classes when deserializing enum entries
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user