[FIR] Fix incorrect psi provided to checker

^KT-60343 fixed
This commit is contained in:
Egor Kulikov
2023-08-31 16:27:37 +02:00
committed by Space Team
parent cb25ef80a9
commit 2f893017ee
8 changed files with 37 additions and 1 deletions
@@ -717,6 +717,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("Kt60343.kt")
public void testKt60343() throws Exception {
runTest("compiler/testData/diagnostics/tests/Kt60343.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
@@ -717,6 +717,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("Kt60343.kt")
public void testKt60343() throws Exception {
runTest("compiler/testData/diagnostics/tests/Kt60343.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
@@ -717,6 +717,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("Kt60343.kt")
public void testKt60343() throws Exception {
runTest("compiler/testData/diagnostics/tests/Kt60343.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
@@ -717,6 +717,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("Kt60343.kt")
public void testKt60343() throws Exception {
runTest("compiler/testData/diagnostics/tests/Kt60343.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
@@ -37,7 +37,7 @@ object FirTypeParameterInQualifiedAccessChecker : FirQualifiedAccessExpressionCh
if (secondLast is FirQualifiedAccessExpression && secondLast.explicitReceiver == expression) return
val diagnostic = expression.coneTypeOrNull?.coneTypeParameterInQualifiedAccess ?: return
val source = expression.source ?: return
val source = expression.calleeReference.source ?: return
reporter.reportOn(source, FirErrors.TYPE_PARAMETER_IS_NOT_AN_EXPRESSION, diagnostic.symbol, context)
}
+3
View File
@@ -0,0 +1,3 @@
fun <T> test(x: Any) {
<!UNRESOLVED_REFERENCE!>println<!>(<!EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS, TYPE_PARAMETER_IS_NOT_AN_EXPRESSION!>T<!><T>)
}
+3
View File
@@ -0,0 +1,3 @@
fun <T> test(x: Any) {
<!UNRESOLVED_REFERENCE!>println<!>(<!RESOLUTION_TO_CLASSIFIER!>T<!><T>)
}
@@ -717,6 +717,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("Kt60343.kt")
public void testKt60343() throws Exception {
runTest("compiler/testData/diagnostics/tests/Kt60343.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {