JS: fix scope of function generated for primary constructor. See KT-15678

This commit is contained in:
Alexey Andreev
2017-01-16 12:22:52 +03:00
parent daac24b62e
commit a927770935
5 changed files with 35 additions and 6 deletions
@@ -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"
}