[FIR] Reproduce KT-64891

^KT-64891
This commit is contained in:
Nikolay Lunyak
2024-01-15 12:31:46 +02:00
committed by Space Team
parent 245409dede
commit 8e6e447d6d
7 changed files with 62 additions and 0 deletions
@@ -429,6 +429,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/finalSupertype.kt");
}
@Test
@TestMetadata("fixExpressionsInQaSelectors.kt")
public void testFixExpressionsInQaSelectors() throws Exception {
runTest("compiler/testData/diagnostics/tests/fixExpressionsInQaSelectors.kt");
}
@Test
@TestMetadata("ForRangeConventions.kt")
public void testForRangeConventions() throws Exception {
@@ -429,6 +429,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/finalSupertype.kt");
}
@Test
@TestMetadata("fixExpressionsInQaSelectors.kt")
public void testFixExpressionsInQaSelectors() throws Exception {
runTest("compiler/testData/diagnostics/tests/fixExpressionsInQaSelectors.kt");
}
@Test
@TestMetadata("ForRangeConventions.kt")
public void testForRangeConventions() throws Exception {
@@ -429,6 +429,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/finalSupertype.kt");
}
@Test
@TestMetadata("fixExpressionsInQaSelectors.kt")
public void testFixExpressionsInQaSelectors() throws Exception {
runTest("compiler/testData/diagnostics/tests/fixExpressionsInQaSelectors.kt");
}
@Test
@TestMetadata("ForRangeConventions.kt")
public void testForRangeConventions() throws Exception {
@@ -429,6 +429,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/finalSupertype.kt");
}
@Test
@TestMetadata("fixExpressionsInQaSelectors.kt")
public void testFixExpressionsInQaSelectors() throws Exception {
runTest("compiler/testData/diagnostics/tests/fixExpressionsInQaSelectors.kt");
}
@Test
@TestMetadata("ForRangeConventions.kt")
public void testForRangeConventions() throws Exception {
@@ -0,0 +1,16 @@
// ISSUE: KT-64891
val b: Int.() -> Int = { 10 }
val Int.b: () -> String get() = { "B" }
fun main() {
5.(b)().<!UNRESOLVED_REFERENCE!>inv<!>() // should be Int
5.b().length // should be String
}
fun <T> id(it: T) = it
fun rain() {
5.(b)().<!UNRESOLVED_REFERENCE!>inv<!>()
5.(id(b))().inv() // should be consistent
}
@@ -0,0 +1,16 @@
// ISSUE: KT-64891
val b: Int.() -> Int = { 10 }
val Int.b: () -> String get() = { "B" }
fun main() {
5.(b)().inv() // should be Int
5.b().length // should be String
}
fun <T> id(it: T) = it
fun rain() {
5.(b)().inv()
5.(id(b))().inv() // should be consistent
}
@@ -429,6 +429,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/finalSupertype.kt");
}
@Test
@TestMetadata("fixExpressionsInQaSelectors.kt")
public void testFixExpressionsInQaSelectors() throws Exception {
runTest("compiler/testData/diagnostics/tests/fixExpressionsInQaSelectors.kt");
}
@Test
@TestMetadata("ForRangeConventions.kt")
public void testForRangeConventions() throws Exception {