Files
kotlin-fork/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.kt
T

11 lines
251 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +VariableDeclarationInWhenSubject
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
fun testNoSubjectVariableName(x: Int?) {
val y = when (val<!SYNTAX!><!> = 42) {
0 -> "0"
else -> "not 0"
}
}