JS: fix translation of delegated constructor call from secondary constructor when argument is a complex expression which translates to multiple statements. See KT-15357
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
var log = ""
|
||||
|
||||
open class Base(val s: String)
|
||||
|
||||
class A(i: Int) : Base("O" + if (i == 23) {
|
||||
log += "logged"
|
||||
"K"
|
||||
}
|
||||
else {
|
||||
"fail"
|
||||
})
|
||||
|
||||
fun box(): String {
|
||||
val result = A(23).s
|
||||
if (result != "OK") return "fail: $result"
|
||||
if (log != "logged") return "fail log: $log"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user