[JS IR] Add test on interface with default method calling extension method on super-interface
^KT-42176 fixed
This commit is contained in:
+12
@@ -13178,6 +13178,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// KT-42176
|
||||
interface Top<D>{
|
||||
fun getData(): D
|
||||
fun toString(data: D): String
|
||||
}
|
||||
|
||||
fun <D> Top<D>.getString() = toString(getData())
|
||||
|
||||
abstract class DefaultImpl: Top<Int>{
|
||||
override fun toString(data: Int): String = data.toString()
|
||||
}
|
||||
|
||||
class Bottom(val data: Int): DefaultImpl {
|
||||
override fun getData(): Int = data
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val bottom = Bottom(10).getString()
|
||||
if (bottom != "10") return "fail: $bottom"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// KT-42176
|
||||
interface Top<D>{
|
||||
fun getData(): D
|
||||
fun toString(data: D): String
|
||||
}
|
||||
|
||||
fun <D> Top<D>.getString() = toString(getData())
|
||||
|
||||
interface DefaultImpl: Top<Int>{
|
||||
override fun toString(data: Int): String = data.toString()
|
||||
}
|
||||
|
||||
class Bottom(val data: Int): DefaultImpl {
|
||||
override fun getData(): Int = data
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val bottom = Bottom(10).getString()
|
||||
if (bottom != "10") return "fail: $bottom"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+12
@@ -13178,6 +13178,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
|
||||
+12
@@ -13178,6 +13178,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
|
||||
+10
@@ -11574,6 +11574,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/executionOrder.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+10
@@ -9874,6 +9874,16 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/executionOrder.kt");
|
||||
|
||||
Generated
+10
@@ -9874,6 +9874,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/executionOrder.kt");
|
||||
|
||||
Generated
+10
@@ -9874,6 +9874,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/executionOrder.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+10
@@ -4913,6 +4913,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/extensionFunctions"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("classMethodCallExtensionSuper.kt")
|
||||
public void testClassMethodCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/classMethodCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultMethodInterfaceCallExtensionSuper.kt")
|
||||
public void testDefaultMethodInterfaceCallExtensionSuper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/defaultMethodInterfaceCallExtensionSuper.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("executionOrder.kt")
|
||||
public void testExecutionOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/executionOrder.kt");
|
||||
|
||||
Reference in New Issue
Block a user