f2031ae642
This only applies to JVM and fq-names in declaration references in IR dumps. This enables us to run more irText tests on platforms other than JVM (see KT-58605).
31 lines
712 B
Kotlin
Vendored
31 lines
712 B
Kotlin
Vendored
// WITH_STDLIB
|
|
object A
|
|
|
|
fun testWithSubject(x: Any?) =
|
|
when (x) {
|
|
null -> "null"
|
|
A -> "A"
|
|
is String -> "String"
|
|
!is Number -> "!Number"
|
|
in setOf<Nothing>() -> "nothingness?"
|
|
else -> "something"
|
|
}
|
|
|
|
fun test(x: Any?) =
|
|
when {
|
|
x == null -> "null"
|
|
x == A -> "A"
|
|
x is String -> "String"
|
|
x !is Number -> "!Number"
|
|
x in setOf<Nothing>() -> "nothingness?"
|
|
else -> "something"
|
|
}
|
|
|
|
fun testComma(x: Int) =
|
|
when (x) {
|
|
1, 2, 3, 4 -> "1234"
|
|
5, 6, 7 -> "567"
|
|
8, 9 -> "89"
|
|
else -> "?"
|
|
}
|