Add regression tests for obsolete issues
#KT-50909 #KT-50974 #KT-51888
This commit is contained in:
+18
@@ -22133,6 +22133,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt48993Generic.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50909.kt")
|
||||
public void testKt50909() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50909.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
@@ -29819,6 +29831,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("diamondWithJava.kt")
|
||||
public void testDiamondWithJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance/diamondWithJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
data class Parent(val child: Parent.Child?) {
|
||||
val result =
|
||||
if (this.child == null) foo(this.child)
|
||||
else "Fail"
|
||||
|
||||
@JvmInline
|
||||
value class Child(val value: String)
|
||||
}
|
||||
|
||||
fun foo(x: String?): String =
|
||||
x ?: "OK"
|
||||
|
||||
fun box(): String =
|
||||
Parent(null).result
|
||||
@@ -0,0 +1,29 @@
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// IGNORE_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
public class WhateverUseCase : UseCaseWithParameter<Result<Int>, Int> {
|
||||
override operator fun invoke(param: Result<Int>): Result<Int> {
|
||||
return param.onFailure {
|
||||
return if (it is NumberFormatException)
|
||||
Result.success(0)
|
||||
else
|
||||
Result.failure(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface UseCaseWithParameter<P, R> {
|
||||
operator fun invoke(param: P) : Result<R>
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
fun box(): String {
|
||||
val useCase = WhateverUseCase()
|
||||
return if (useCase(Result.failure(NumberFormatException())) == Result.success(0)) "OK"
|
||||
else "Fail"
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// JVM_TARGET: 1.8
|
||||
// MODULE: lib
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// FILE: P.java
|
||||
|
||||
public interface P {
|
||||
default String test() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: kotlin.kt
|
||||
|
||||
abstract class A : P
|
||||
|
||||
interface B : P
|
||||
|
||||
// MODULE: main(lib)
|
||||
// !JVM_DEFAULT_MODE: disable
|
||||
// FILE: main.kt
|
||||
abstract class C : A(), P, B
|
||||
|
||||
fun box(): String {
|
||||
return object : C() {}.test()
|
||||
}
|
||||
+6
@@ -21443,6 +21443,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt48993Generic.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
|
||||
+18
@@ -22133,6 +22133,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt48993Generic.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50909.kt")
|
||||
public void testKt50909() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50909.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
@@ -29819,6 +29831,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("diamondWithJava.kt")
|
||||
public void testDiamondWithJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/jvm8/defaults/nonDefaultInheritance/diamondWithJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
|
||||
+5
@@ -16613,6 +16613,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt45991.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void ignoreKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mappingOfBoxedFlexibleInlineClassTypeGeneric.kt")
|
||||
public void ignoreMappingOfBoxedFlexibleInlineClassTypeGeneric() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/mappingOfBoxedFlexibleInlineClassTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
|
||||
+6
@@ -16873,6 +16873,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt47823.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
|
||||
+6
@@ -16885,6 +16885,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt47823.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
|
||||
+5
@@ -14955,6 +14955,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt47823.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51157.kt");
|
||||
|
||||
+6
@@ -18601,6 +18601,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt47823.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50974_resultMultiModule.kt")
|
||||
public void testKt50974_resultMultiModule() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt50974_resultMultiModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51157.kt")
|
||||
public void testKt51157() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user