Report error about uninferred type parameter for all CallForImplicitInvoke psi calls
^KT-44368 Fixed
This commit is contained in:
+6
@@ -11835,6 +11835,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/equalitySubstitutionInsideNonInvariantType.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/equalitySubstitutionInsideNonInvariantType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorsOnImplicitInvokeInSimpleCall.kt")
|
||||||
|
public void testErrorsOnImplicitInvokeInSimpleCall() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/errorsOnImplicitInvokeInSimpleCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("expectedTypeAdditionalTest.kt")
|
@TestMetadata("expectedTypeAdditionalTest.kt")
|
||||||
public void testExpectedTypeAdditionalTest() throws Exception {
|
public void testExpectedTypeAdditionalTest() throws Exception {
|
||||||
|
|||||||
+8
-2
@@ -446,8 +446,14 @@ class DiagnosticReporterByTrackingStrategy(
|
|||||||
|
|
||||||
if (isDiagnosticRedundant) return
|
if (isDiagnosticRedundant) return
|
||||||
val expression = when (val atom = error.resolvedAtom.atom) {
|
val expression = when (val atom = error.resolvedAtom.atom) {
|
||||||
is PSIKotlinCallForInvoke -> (atom.psiCall as? CallTransformer.CallForImplicitInvoke)?.outerCall?.calleeExpression
|
is PSIKotlinCall -> {
|
||||||
is PSIKotlinCall -> atom.psiCall.calleeExpression
|
val psiCall = atom.psiCall
|
||||||
|
if (psiCall is CallTransformer.CallForImplicitInvoke) {
|
||||||
|
psiCall.outerCall.calleeExpression
|
||||||
|
} else {
|
||||||
|
psiCall.calleeExpression
|
||||||
|
}
|
||||||
|
}
|
||||||
is PSIKotlinCallArgument -> atom.valueArgument.getArgumentExpression()
|
is PSIKotlinCallArgument -> atom.valueArgument.getArgumentExpression()
|
||||||
else -> call.calleeExpression
|
else -> call.calleeExpression
|
||||||
} ?: return
|
} ?: return
|
||||||
|
|||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
inline operator fun <reified T> Int.invoke() = this
|
||||||
|
|
||||||
|
val a2 = 1()
|
||||||
|
val a3 = 1.invoke()
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
inline operator fun <reified T> Int.invoke() = this
|
||||||
|
|
||||||
|
val a2 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>1<!>()
|
||||||
|
val a3 = 1.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>invoke<!>()
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public val a2: kotlin.Int
|
||||||
|
public val a3: kotlin.Int
|
||||||
|
public inline operator fun </*0*/ reified T> kotlin.Int.invoke(): kotlin.Int
|
||||||
Generated
+6
@@ -11841,6 +11841,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/equalitySubstitutionInsideNonInvariantType.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/equalitySubstitutionInsideNonInvariantType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorsOnImplicitInvokeInSimpleCall.kt")
|
||||||
|
public void testErrorsOnImplicitInvokeInSimpleCall() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/errorsOnImplicitInvokeInSimpleCall.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("expectedTypeAdditionalTest.kt")
|
@TestMetadata("expectedTypeAdditionalTest.kt")
|
||||||
public void testExpectedTypeAdditionalTest() throws Exception {
|
public void testExpectedTypeAdditionalTest() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user