Test for KT-2532 Exception on trying to override delegated member.
#KT-2532 Fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
trait B {
|
||||||
|
val c: Int
|
||||||
|
get() = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
class A(val b: B) : B by b {
|
||||||
|
override val c: Int = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val c = A(object: B {}).c
|
||||||
|
return if (c == 3) "OK" else "fail: $c"
|
||||||
|
}
|
||||||
@@ -122,6 +122,11 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
blackBoxFile("classes/inheritedInnerClass.jet");
|
blackBoxFile("classes/inheritedInnerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt2532() throws Exception {
|
||||||
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
|
blackBoxFile("classes/kt2532.kt");
|
||||||
|
}
|
||||||
|
|
||||||
public void testInitializerBlock() throws Exception {
|
public void testInitializerBlock() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/initializerBlock.jet");
|
blackBoxFile("classes/initializerBlock.jet");
|
||||||
|
|||||||
Reference in New Issue
Block a user