Add tests making sure that a couple of issues are fixed by PCLA
^KT-49283 Fixed ^KT-64077 Fixed
This commit is contained in:
committed by
Space Team
parent
fb8cc00d1f
commit
a4ccb72b94
+6
@@ -4147,6 +4147,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt64077.kt")
|
||||||
|
public void testKt64077() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64077.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt64222.kt")
|
@TestMetadata("kt64222.kt")
|
||||||
public void testKt64222() throws Exception {
|
public void testKt64222() throws Exception {
|
||||||
|
|||||||
+6
@@ -2889,6 +2889,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+6
@@ -4147,6 +4147,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt64077.kt")
|
||||||
|
public void testKt64077() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64077.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt64222.kt")
|
@TestMetadata("kt64222.kt")
|
||||||
public void testKt64222() throws Exception {
|
public void testKt64222() throws Exception {
|
||||||
|
|||||||
+6
@@ -2889,6 +2889,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+6
@@ -4141,6 +4141,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt64077.kt")
|
||||||
|
public void testKt64077() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64077.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt64222.kt")
|
@TestMetadata("kt64222.kt")
|
||||||
public void testKt64222() throws Exception {
|
public void testKt64222() throws Exception {
|
||||||
|
|||||||
+6
@@ -4147,6 +4147,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt64077.kt")
|
||||||
|
public void testKt64077() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64077.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt64222.kt")
|
@TestMetadata("kt64222.kt")
|
||||||
public void testKt64222() throws Exception {
|
public void testKt64222() throws Exception {
|
||||||
|
|||||||
+6
@@ -2872,6 +2872,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+6
@@ -2872,6 +2872,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+6
@@ -2872,6 +2872,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// WITH_STDLIB
|
||||||
|
// ISSUE: KT-49283
|
||||||
|
|
||||||
|
// IGNORE_BACKEND_K1: ANY
|
||||||
|
|
||||||
|
fun takeListOfStrings(x: List<String>) {}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val result = buildList l1@ { // Not enough information to infer type variable E, but could be inferred into String
|
||||||
|
val anotherList = buildList {
|
||||||
|
takeListOfStrings(this)
|
||||||
|
this@l1.add("OK")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result[0]
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// ISSUE: KT-64077
|
||||||
|
fun <R1> build(block: InvBuilder<R1>.() -> Unit): R1 = TODO()
|
||||||
|
fun <R2> build2(block: InvBuilder<R2>.() -> Unit): R2 = TODO()
|
||||||
|
|
||||||
|
class InvBuilder<R>() {
|
||||||
|
fun set(r: R) {}
|
||||||
|
fun get(): R = TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consumeInt(e: Int) {}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val ret = build {
|
||||||
|
set("")
|
||||||
|
build2 {
|
||||||
|
set(1)
|
||||||
|
consumeInt(<!ARGUMENT_TYPE_MISMATCH!>this@build.get()<!>) // K1 red ARGUMENT_TYPE_MISMATCH, runtime crash K2
|
||||||
|
}
|
||||||
|
Unit // This unit is essential!!!
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// ISSUE: KT-64077
|
||||||
|
fun <R1> build(block: InvBuilder<R1>.() -> Unit): R1 = TODO()
|
||||||
|
fun <R2> build2(block: InvBuilder<R2>.() -> Unit): R2 = TODO()
|
||||||
|
|
||||||
|
class InvBuilder<R>() {
|
||||||
|
fun set(r: R) {}
|
||||||
|
fun get(): R = TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun consumeInt(e: Int) {}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val ret = build {
|
||||||
|
set("")
|
||||||
|
build2 {
|
||||||
|
set(1)
|
||||||
|
consumeInt(<!TYPE_MISMATCH!>this@build.get()<!>) // K1 red ARGUMENT_TYPE_MISMATCH, runtime crash K2
|
||||||
|
}
|
||||||
|
Unit // This unit is essential!!!
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -4147,6 +4147,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt64077.kt")
|
||||||
|
public void testKt64077() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64077.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt64222.kt")
|
@TestMetadata("kt64222.kt")
|
||||||
public void testKt64222() throws Exception {
|
public void testKt64222() throws Exception {
|
||||||
|
|||||||
+6
@@ -2872,6 +2872,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+6
@@ -2872,6 +2872,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+6
@@ -2872,6 +2872,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
|
|||||||
+5
@@ -2505,6 +2505,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49263.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt49283.kt")
|
||||||
|
public void testKt49283() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt49283.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt50453.kt")
|
@TestMetadata("kt50453.kt")
|
||||||
public void testKt50453() throws Exception {
|
public void testKt50453() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/builderInference/issues/kt50453.kt");
|
runTest("compiler/testData/codegen/box/builderInference/issues/kt50453.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user