Add test for VAL_REASSIGNMENT on when subject variable
This commit is contained in:
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -UNUSED_VALUE
|
||||
|
||||
fun foo(): Any = 42
|
||||
|
||||
fun test(x: Any) {
|
||||
when (val y = foo()) {
|
||||
is String -> <!VAL_REASSIGNMENT!>y<!> = ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user