[FIR] add missing resolve for ConeFunctionExpectedError building

^KT-60638 Fixed
This commit is contained in:
Dmitrii Gridin
2023-07-24 22:44:55 +02:00
committed by Space Team
parent ba7e6ff154
commit d93ffe0aec
12 changed files with 102 additions and 1 deletions
@@ -651,6 +651,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt60638.kt");
}
@Test
@TestMetadata("LValueAssignment.kt")
public void testLValueAssignment() throws Exception {
@@ -651,6 +651,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt60638.kt");
}
@Test
@TestMetadata("LValueAssignment.kt")
public void testLValueAssignment() throws Exception {
@@ -717,7 +717,9 @@ class FirCallResolver(
coneType != null && !coneType.isUnit -> {
ConeFunctionExpectedError(
name.asString(),
(fir as? FirCallableDeclaration)?.returnTypeRef?.coneType ?: coneType
(fir as? FirCallableDeclaration)?.let {
components.returnTypeCalculator.tryCalculateReturnType(it)
}?.coneType ?: coneType
)
}
singleExpectedCandidate != null && !singleExpectedCandidate.currentApplicability.isSuccess -> {
+9
View File
@@ -0,0 +1,9 @@
package usage
class MyType
class MyClass
val MyClass.isInterface get() = 4
fun usage(type: MyType) {
type.<!FUNCTION_EXPECTED!>isInterface<!>()
}
+9
View File
@@ -0,0 +1,9 @@
package usage
class MyType
class MyClass
val MyClass.isInterface get() = 4
fun usage(type: MyType) {
type.<!FUNCTION_EXPECTED, UNRESOLVED_REFERENCE_WRONG_RECEIVER!>isInterface<!>()
}
@@ -651,6 +651,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/kt58583.kt");
}
@Test
@TestMetadata("kt60638.kt")
public void testKt60638() throws Exception {
runTest("compiler/testData/diagnostics/tests/kt60638.kt");
}
@Test
@TestMetadata("LValueAssignment.kt")
public void testLValueAssignment() throws Exception {