Fix TCE for invalid code with wrong callee expression
#KT-14927 Fixed
This commit is contained in:
@@ -276,9 +276,11 @@ class QualifiedExpressionResolver {
|
||||
return true
|
||||
}
|
||||
if (doubleColonLHS && expression is KtCallExpression && expression.isWithoutValueArguments) {
|
||||
val simpleName = expression.calleeExpression as KtSimpleNameExpression
|
||||
result.add(QualifierPart(simpleName.getReferencedNameAsName(), simpleName, expression.typeArgumentList))
|
||||
return true
|
||||
val simpleName = expression.calleeExpression
|
||||
if (simpleName is KtSimpleNameExpression) {
|
||||
result.add(QualifierPart(simpleName.getReferencedNameAsName(), simpleName, expression.typeArgumentList))
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
val unwrapped = <!UNRESOLVED_REFERENCE!>some<!><!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!><<!><!DEBUG_INFO_MISSING_UNRESOLVED!>sdf<!>()()<out <!DEBUG_INFO_MISSING_UNRESOLVED!>Any<!>>::<!UNRESOLVED_REFERENCE!>unwrap<!>
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public val unwrapped: [ERROR : Type for some<sdf()()<out Any>::unwrap]
|
||||
+1
@@ -0,0 +1 @@
|
||||
val unwrapped = <!UNRESOLVED_REFERENCE!>some<!>.<!SYNTAX!><<!><!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>cabc<!><!SYNTAX!>$Wrapper<!><out <!DEBUG_INFO_MISSING_UNRESOLVED!>Any<!>>::<!UNRESOLVED_REFERENCE!>unwrap<!>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public val unwrapped: [ERROR : <ERROR FUNCTION RETURN TYPE>]
|
||||
@@ -15946,6 +15946,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/qualifiedExpression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("calleeExpressionAsCallExpression.kt")
|
||||
public void testCalleeExpressionAsCallExpression() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("GenericClassVsPackage.kt")
|
||||
public void testGenericClassVsPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.kt");
|
||||
@@ -15958,6 +15964,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullCalleeExpression.kt")
|
||||
public void testNullCalleeExpression() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PackageVsClass.kt")
|
||||
public void testPackageVsClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user