[FIR] add missing resolve for ConeFunctionExpectedError building
^KT-60638 Fixed
This commit is contained in:
committed by
Space Team
parent
ba7e6ff154
commit
d93ffe0aec
@@ -0,0 +1,9 @@
|
||||
package usage
|
||||
|
||||
class MyType
|
||||
class MyClass
|
||||
val MyClass.isInterface get() = 4
|
||||
|
||||
fun usage(type: MyType) {
|
||||
type.<expr>isInterface</expr>()
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
KT element: KtNameReferenceExpression
|
||||
FIR element: FirErrorNamedReferenceImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
<Expression 'isInterface' of type 'kotlin/Int' cannot be invoked as a function>#
|
||||
|
||||
FIR FILE:
|
||||
FILE: [ResolvedTo(IMPORTS)] kt60638.kt
|
||||
package usage
|
||||
|
||||
public final [ResolvedTo(STATUS)] class MyType : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=MyType] constructor(): R|usage/MyType| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
}
|
||||
public final [ResolvedTo(STATUS)] class MyClass : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] constructor(): R|usage/MyClass| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
}
|
||||
public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val R|usage/MyClass|.isInterface: R|kotlin/Int|
|
||||
public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| {
|
||||
^ Int(4)
|
||||
}
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun usage([ResolvedTo(BODY_RESOLVE)] type: R|usage/MyType|): R|kotlin/Unit| {
|
||||
R|<local>/type|.<Expression 'isInterface' of type 'kotlin/Int' cannot be invoked as a function>#()
|
||||
}
|
||||
+6
@@ -24,6 +24,12 @@ public class OutOfContentRootGetOrBuildFirTestGenerated extends AbstractOutOfCon
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt60638.kt")
|
||||
public void testKt60638() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/kt60638.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -24,6 +24,12 @@ public class SourceGetOrBuildFirTestGenerated extends AbstractSourceGetOrBuildFi
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt60638.kt")
|
||||
public void testKt60638() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/kt60638.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -651,6 +651,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
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 {
|
||||
|
||||
+6
@@ -651,6 +651,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 -> {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package usage
|
||||
|
||||
class MyType
|
||||
class MyClass
|
||||
val MyClass.isInterface get() = 4
|
||||
|
||||
fun usage(type: MyType) {
|
||||
type.<!FUNCTION_EXPECTED!>isInterface<!>()
|
||||
}
|
||||
@@ -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<!>()
|
||||
}
|
||||
Generated
+6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user