Test for KT-2532 Exception on trying to override delegated member.

#KT-2532 Fixed
This commit is contained in:
Andrey Breslav
2012-09-07 14:48:50 +04:00
parent 15b5ba5b51
commit 7b01ce5acb
2 changed files with 20 additions and 0 deletions
@@ -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");
}
public void testKt2532() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
blackBoxFile("classes/kt2532.kt");
}
public void testInitializerBlock() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
blackBoxFile("classes/initializerBlock.jet");