Tests for KT-1714 Reference to function is generated with private getter method
#KT-1714 fixed
This commit is contained in:
@@ -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"
|
||||||
|
}
|
||||||
@@ -231,4 +231,14 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
createEnvironmentWithFullJdk();
|
createEnvironmentWithFullJdk();
|
||||||
blackBoxFile("regressions/kt1482.kt");
|
blackBoxFile("regressions/kt1482.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt1714() throws Exception {
|
||||||
|
createEnvironmentWithFullJdk();
|
||||||
|
blackBoxFile("regressions/kt1714.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testKt1714_minimal() throws Exception {
|
||||||
|
createEnvironmentWithFullJdk();
|
||||||
|
blackBoxFile("regressions/kt1714_minimal.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user