[JS IR] Add test to check proper type substitution
This commit is contained in:
committed by
TeamCityServer
parent
d4ace2ffe8
commit
38f21b7139
+6
@@ -22936,6 +22936,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun fooInt(b: (Int, Int) -> String): String {
|
||||
return b(3, 5)
|
||||
}
|
||||
|
||||
fun fooULong(b: (ULong, ULong) -> String): String {
|
||||
return b(3UL, 7UL)
|
||||
}
|
||||
|
||||
fun barInt(i: Int): String {
|
||||
return "FAIINTL1".get(i).toString()
|
||||
}
|
||||
|
||||
fun barULong(l: ULong): String {
|
||||
return "FAIULONGL2".get(l.toInt()).toString()
|
||||
}
|
||||
|
||||
fun testInt(): String {
|
||||
return fooInt { from, to ->
|
||||
var r = ""
|
||||
for (index in from..to) {
|
||||
r += barInt(index)
|
||||
}
|
||||
r
|
||||
}
|
||||
}
|
||||
|
||||
fun testULong(): String {
|
||||
return fooULong { from, to ->
|
||||
var r = ""
|
||||
for (index in from..to) {
|
||||
r += barULong(index)
|
||||
}
|
||||
r
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val r1 = testInt()
|
||||
|
||||
if (r1 != "INT") return "FAIL1: $r1"
|
||||
|
||||
val r2 = testULong()
|
||||
|
||||
if (r2 != "ULONG") return "FAIL2: $r2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -22804,6 +22804,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
|
||||
+6
@@ -22936,6 +22936,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
|
||||
+5
@@ -19109,6 +19109,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/objectClass.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -16183,6 +16183,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/objectClass.kt");
|
||||
|
||||
Generated
+5
@@ -15589,6 +15589,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/objectClass.kt");
|
||||
|
||||
Generated
+5
@@ -15619,6 +15619,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/objectClass.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -10688,6 +10688,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/ir/kt41765.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaWithLoop.kt")
|
||||
public void testLambdaWithLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/lambdaWithLoop.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("objectClass.kt")
|
||||
public void testObjectClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/objectClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user