mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 08:31:31 +00:00
16 lines
300 B
Kotlin
Vendored
16 lines
300 B
Kotlin
Vendored
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"
|
|
}
|
|
}
|