mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
21 lines
413 B
Kotlin
Vendored
21 lines
413 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS
|
|
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.reflect.jvm.*
|
|
|
|
enum class E
|
|
|
|
fun box(): String {
|
|
try {
|
|
val c = E::class.constructors.single()
|
|
c.isAccessible = true
|
|
c.call()
|
|
return "Fail: constructing an enum class should not be allowed"
|
|
}
|
|
catch (e: Throwable) {
|
|
return "OK"
|
|
}
|
|
}
|