JS: fix non-abstract extension properties in interfaces

KT-20994
This commit is contained in:
Alexey Andreev
2017-10-30 13:03:03 +03:00
parent 9e061d3bbb
commit bd7129d0d6
6 changed files with 65 additions and 19 deletions
@@ -0,0 +1,19 @@
interface I {
val String.foo: String
get() = this + ";" + bar()
fun bar(): String
}
class C : I {
override fun bar() = "C.bar"
fun test() = "test".foo
}
fun box(): String {
val r = C().test()
if (r != "test;C.bar") return "fail: $r"
return "OK"
}
@@ -8591,6 +8591,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("nonAbstractInInterface.kt")
public void testNonAbstractInInterface() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionProperties/nonAbstractInInterface.kt");
doTest(fileName);
}
@TestMetadata("topLevel.kt")
public void testTopLevel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionProperties/topLevel.kt");
@@ -8591,6 +8591,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("nonAbstractInInterface.kt")
public void testNonAbstractInInterface() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionProperties/nonAbstractInInterface.kt");
doTest(fileName);
}
@TestMetadata("topLevel.kt")
public void testTopLevel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionProperties/topLevel.kt");
@@ -8591,6 +8591,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("nonAbstractInInterface.kt")
public void testNonAbstractInInterface() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionProperties/nonAbstractInInterface.kt");
doTest(fileName);
}
@TestMetadata("topLevel.kt")
public void testTopLevel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/extensionProperties/topLevel.kt");