KT-4173: Can't pass a non-trivial closure to a super-call for object expression

#KT-4173 Fixed
This commit is contained in:
Mikhael Bogdanov
2013-11-08 13:58:58 +04:00
parent 2c75bdacc5
commit df03eb5330
5 changed files with 151 additions and 22 deletions
@@ -0,0 +1,18 @@
open class C(val f: () -> Unit) {
fun test() {
f()
}
}
class B(var x: Int) {
fun foo() {
object : C({x = 3}) {}.test()
}
}
fun box() : String {
val b = B(1)
b.foo()
return if (b.x != 3) "fail: b.x = ${b.x}" else "OK"
}