Lift assignment out: do not report when assignment variables are different
#KT-38649 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
498c40548b
commit
5efbbdea57
+18
@@ -0,0 +1,18 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A {
|
||||
val list: MutableList<String> = mutableListOf()
|
||||
}
|
||||
|
||||
class B {
|
||||
val list: MutableList<String> = mutableListOf()
|
||||
}
|
||||
|
||||
fun Any.add(s: String) {
|
||||
<caret>when (this) {
|
||||
is A -> list += s
|
||||
is B -> list += s
|
||||
else -> throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user