[FE] Add regression test for KT-57036
This commit is contained in:
committed by
Space Team
parent
e56e058b7b
commit
1ac7d13c96
+6
@@ -31442,6 +31442,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kFunctionalCST.kt")
|
||||||
|
public void testKFunctionalCST() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/subtyping/kFunctionalCST.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt2069.kt")
|
@TestMetadata("kt2069.kt")
|
||||||
public void testKt2069() throws Exception {
|
public void testKt2069() throws Exception {
|
||||||
|
|||||||
+6
@@ -31442,6 +31442,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kFunctionalCST.kt")
|
||||||
|
public void testKFunctionalCST() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/subtyping/kFunctionalCST.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt2069.kt")
|
@TestMetadata("kt2069.kt")
|
||||||
public void testKt2069() throws Exception {
|
public void testKt2069() throws Exception {
|
||||||
|
|||||||
+6
@@ -31442,6 +31442,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kFunctionalCST.kt")
|
||||||
|
public void testKFunctionalCST() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/subtyping/kFunctionalCST.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt2069.kt")
|
@TestMetadata("kt2069.kt")
|
||||||
public void testKt2069() throws Exception {
|
public void testKt2069() throws Exception {
|
||||||
|
|||||||
+6
@@ -31538,6 +31538,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kFunctionalCST.kt")
|
||||||
|
public void testKFunctionalCST() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/subtyping/kFunctionalCST.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt2069.kt")
|
@TestMetadata("kt2069.kt")
|
||||||
public void testKt2069() throws Exception {
|
public void testKt2069() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// INFERENCE_HELPERS
|
||||||
|
// ISSUE: KT-57036
|
||||||
|
|
||||||
|
abstract class Base(block: String.() -> Int)
|
||||||
|
class A(block: String.() -> Int) : Base(block)
|
||||||
|
class B(block: String.() -> Int) : Base(block)
|
||||||
|
|
||||||
|
fun test_1() {
|
||||||
|
val c = select(::A, ::B)
|
||||||
|
c { length }
|
||||||
|
c { <!UNRESOLVED_REFERENCE!>it<!>.length }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test_2(cond: Boolean) {
|
||||||
|
val c = if (cond) ::A else ::B
|
||||||
|
c { length }
|
||||||
|
c { <!UNRESOLVED_REFERENCE!>it<!>.length }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test_3(cond: Boolean) {
|
||||||
|
val c = when(cond) {
|
||||||
|
true -> ::A
|
||||||
|
false -> ::B
|
||||||
|
}
|
||||||
|
c { length }
|
||||||
|
c { <!UNRESOLVED_REFERENCE!>it<!>.length }
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// INFERENCE_HELPERS
|
||||||
|
// ISSUE: KT-57036
|
||||||
|
|
||||||
|
abstract class Base(block: String.() -> Int)
|
||||||
|
class A(block: String.() -> Int) : Base(block)
|
||||||
|
class B(block: String.() -> Int) : Base(block)
|
||||||
|
|
||||||
|
fun test_1() {
|
||||||
|
val c = select(::A, ::B)
|
||||||
|
c <!TYPE_MISMATCH!>{ <!UNRESOLVED_REFERENCE!>length<!> }<!>
|
||||||
|
c { it.length }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test_2(cond: Boolean) {
|
||||||
|
val c = if (cond) ::A else ::B
|
||||||
|
c <!TYPE_MISMATCH!>{ <!UNRESOLVED_REFERENCE!>length<!> }<!>
|
||||||
|
c { it.length }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test_3(cond: Boolean) {
|
||||||
|
val c = when(cond) {
|
||||||
|
true -> ::A
|
||||||
|
false -> ::B
|
||||||
|
}
|
||||||
|
c <!TYPE_MISMATCH!>{ <!UNRESOLVED_REFERENCE!>length<!> }<!>
|
||||||
|
c { it.length }
|
||||||
|
}
|
||||||
Generated
+6
@@ -32280,6 +32280,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
runTest("compiler/testData/diagnostics/tests/subtyping/javaAndKotlinSuperType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kFunctionalCST.kt")
|
||||||
|
public void testKFunctionalCST() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/subtyping/kFunctionalCST.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt2069.kt")
|
@TestMetadata("kt2069.kt")
|
||||||
public void testKt2069() throws Exception {
|
public void testKt2069() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user