JS: fix scope of function generated for primary constructor. See KT-15678
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
var log = ""
|
||||
|
||||
inline fun f(x: Int): Int {
|
||||
val result = x * 2
|
||||
log += "f($x)"
|
||||
return result
|
||||
}
|
||||
|
||||
fun bar() = 10
|
||||
|
||||
class Test {
|
||||
val value: Int
|
||||
|
||||
init {
|
||||
val x = 3
|
||||
val y = f(bar())
|
||||
value = x + y
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val test = Test()
|
||||
if (test.value != 23) return "fail: ${test.value}"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user