Minor. Add regression test
#KT-45991
This commit is contained in:
+6
@@ -17982,6 +17982,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// IGNORE_BACKEND: JVM
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
|
||||
var result = ""
|
||||
|
||||
fun ex1_(res: Result<Int>) {
|
||||
res.fold(
|
||||
onSuccess = { result += "Ex $it\n" },
|
||||
onFailure = {},
|
||||
)
|
||||
}
|
||||
|
||||
fun ex1(res: Result<Int>) {
|
||||
res.fold(
|
||||
onSuccess = { ex1_(res) },
|
||||
onFailure = { ex1_(Result.failure(it)) }
|
||||
)
|
||||
}
|
||||
|
||||
val ex2_: (Result<Int>) -> Unit = { res ->
|
||||
res.fold(
|
||||
onSuccess = { result += "Ex $it\n" },
|
||||
onFailure = {},
|
||||
)
|
||||
}
|
||||
|
||||
val ex2: (Result<Int>) -> Unit = { res ->
|
||||
res.fold(
|
||||
onSuccess = { ex2_(Result.success(it)) },
|
||||
onFailure = { ex2_(Result.failure(it)) }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
val ex3_: (Result<Int>) -> Unit = { res ->
|
||||
res.fold(
|
||||
onSuccess = { result += "Ex $it\n" },
|
||||
onFailure = {},
|
||||
)
|
||||
}
|
||||
|
||||
val ex3: (Result<Int>) -> Unit = { res ->
|
||||
res.fold(
|
||||
onSuccess = { ex3_(res) },
|
||||
onFailure = { ex3_(Result.failure(it)) }
|
||||
)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
ex1(Result.success(1))
|
||||
ex2(Result.success(2))
|
||||
ex3(Result.success(3))
|
||||
return if (result == "Ex 1\nEx 2\nEx 3\n") "OK" else "FAIL $result"
|
||||
}
|
||||
+6
@@ -17964,6 +17964,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
|
||||
+6
@@ -17982,6 +17982,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
|
||||
+5
@@ -14253,6 +14253,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void ignoreKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("safeAsOfTypeParameterWithInlineClassBound.kt")
|
||||
public void ignoreSafeAsOfTypeParameterWithInlineClassBound() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -13085,6 +13085,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
|
||||
|
||||
Generated
+5
@@ -12506,6 +12506,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
|
||||
|
||||
Generated
+5
@@ -12571,6 +12571,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -6812,6 +6812,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt45991.kt")
|
||||
public void testKt45991() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
|
||||
|
||||
Reference in New Issue
Block a user