提交 50ab9ed0 编写于 作者: I Ilya Goncharov

[JS IR] Add test on interface with default method calling extension method on super-interface

^KT-42176 fixed
上级 5c28762c
......@@ -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 {
// 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"
}
\ No newline at end of file
// 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"
}
\ No newline at end of file
......@@ -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 {
......@@ -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 {
......@@ -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");
......@@ -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");
......@@ -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");
......@@ -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");
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册