FIR. Fix smart-cast expression unwrapping in plus with assign resolve
This commit is contained in:
committed by
teamcity
parent
f946496979
commit
8f51c51eee
+23
@@ -0,0 +1,23 @@
|
||||
FILE: plusWithAssignSmartCast.kt
|
||||
public final class Foo : R|kotlin/Any| {
|
||||
public constructor(): R|Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final var bar: R|kotlin/String?| = Null(null)
|
||||
public get(): R|kotlin/String?|
|
||||
public set(value: R|kotlin/String?|): R|kotlin/Unit|
|
||||
|
||||
public final fun addToBar(other: R|kotlin/String|): R|kotlin/Unit| {
|
||||
when () {
|
||||
==(this@R|/Foo|.R|/Foo.bar|, Null(null)) -> {
|
||||
this@R|/Foo|.R|/Foo.bar| = R|<local>/other|
|
||||
}
|
||||
else -> {
|
||||
this@R|/Foo|.R|/Foo.bar| = this@R|/Foo|.R|/Foo.bar|.R|kotlin/plus|(<strcat>(String( ), R|<local>/other|))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
var bar: String? = null
|
||||
|
||||
fun addToBar(other: String) {
|
||||
if (bar == null) {
|
||||
bar = other
|
||||
} else {
|
||||
bar += " $other"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user