Migrate all JDK 15 related tests to JDK 17
This commit is contained in:
committed by
TeamCityServer
parent
452dfd6edd
commit
ce3562f0e8
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// WITH_REFLECT
|
||||
// FILE: Base.java
|
||||
public sealed class Base permits O, K {}
|
||||
|
||||
// FILE: O.java
|
||||
public final class O extends Base {}
|
||||
|
||||
// FILE: K.java
|
||||
public non-sealed class K extends Base {}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun box(): String {
|
||||
val klass = Base::class
|
||||
if (!klass.isSealed) return "Error: Base is not sealed"
|
||||
if (klass.isAbstract) return "Error: Base is not abstract"
|
||||
return klass.sealedSubclasses
|
||||
.joinToString("") { it.simpleName ?: "_No name provided_" }
|
||||
.takeIf { it.isNotBlank() }
|
||||
?: "_No sealed subclasses found_"
|
||||
}
|
||||
Reference in New Issue
Block a user