Tests for KT-1714 Reference to function is generated with private getter method

#KT-1714 fixed
This commit is contained in:
Evgeny Gerashchenko
2012-06-16 19:23:03 +04:00
parent e45833b213
commit 86c8e4bf18
3 changed files with 45 additions and 0 deletions
@@ -0,0 +1,23 @@
trait A {
val method : (() -> Unit )?
val test : Integer
}
class AImpl : A {
override val method : (() -> Unit )? = {
}
override val test : Integer = Integer(777)
}
fun test(a : A) {
val method = a.method
if (method != null) {
method()
}
}
public fun box() : String {
AImpl().test
test(AImpl())
return "OK"
}
@@ -0,0 +1,12 @@
trait A {
val v: Int
}
class AImpl : A {
override val v: Int = 5
}
public fun box() : String {
(AImpl() : A).v
return "OK"
}