[FE 1.0] Don't fail with exception on unresolved type with type argument
^KT-50223 Fixed
This commit is contained in:
committed by
teamcity
parent
87dc1f7fde
commit
372879b8e7
+6
@@ -13356,6 +13356,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unresolvedTypeWithTypeArguments.kt")
|
||||||
|
public void testUnresolvedTypeWithTypeArguments() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedTypeWithTypeArguments.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("variableDeclarationInSelector.kt")
|
@TestMetadata("variableDeclarationInSelector.kt")
|
||||||
public void testVariableDeclarationInSelector() throws Exception {
|
public void testVariableDeclarationInSelector() throws Exception {
|
||||||
|
|||||||
+6
@@ -13356,6 +13356,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unresolvedTypeWithTypeArguments.kt")
|
||||||
|
public void testUnresolvedTypeWithTypeArguments() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedTypeWithTypeArguments.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("variableDeclarationInSelector.kt")
|
@TestMetadata("variableDeclarationInSelector.kt")
|
||||||
public void testVariableDeclarationInSelector() throws Exception {
|
public void testVariableDeclarationInSelector() throws Exception {
|
||||||
|
|||||||
+6
@@ -13356,6 +13356,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unresolvedTypeWithTypeArguments.kt")
|
||||||
|
public void testUnresolvedTypeWithTypeArguments() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedTypeWithTypeArguments.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("variableDeclarationInSelector.kt")
|
@TestMetadata("variableDeclarationInSelector.kt")
|
||||||
public void testVariableDeclarationInSelector() throws Exception {
|
public void testVariableDeclarationInSelector() throws Exception {
|
||||||
|
|||||||
+3
-2
@@ -136,10 +136,11 @@ class CompletionModeCalculator {
|
|||||||
fixationDirectionsCollector: MutableSet<FixationDirectionForVariable>
|
fixationDirectionsCollector: MutableSet<FixationDirectionForVariable>
|
||||||
) {
|
) {
|
||||||
val typeArgumentsCount = type.argumentsCount()
|
val typeArgumentsCount = type.argumentsCount()
|
||||||
if (typeArgumentsCount > 0) {
|
val typeConstructor = type.typeConstructor()
|
||||||
|
if (typeArgumentsCount > 0 && typeArgumentsCount == typeConstructor.parametersCount()) {
|
||||||
for (position in 0 until typeArgumentsCount) {
|
for (position in 0 until typeArgumentsCount) {
|
||||||
val argument = type.getArgument(position)
|
val argument = type.getArgument(position)
|
||||||
val parameter = type.typeConstructor().getParameter(position)
|
val parameter = typeConstructor.getParameter(position)
|
||||||
|
|
||||||
if (argument.isStarProjection())
|
if (argument.isStarProjection())
|
||||||
continue
|
continue
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
abstract class MyClass {
|
||||||
|
abstract fun <P1> foo(): (P1) -> <!UNRESOLVED_REFERENCE!>Unknown<String><!>
|
||||||
|
|
||||||
|
private fun callTryConvertConstant() {
|
||||||
|
<!UNRESOLVED_REFERENCE!>println<!>(foo<String>())
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
abstract class MyClass {
|
||||||
|
abstract fun <P1> foo(): (P1) -> <!UNRESOLVED_REFERENCE!>Unknown<!><String>
|
||||||
|
|
||||||
|
private fun callTryConvertConstant() {
|
||||||
|
<!UNRESOLVED_REFERENCE!>println<!>(foo<String>())
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public abstract class MyClass {
|
||||||
|
public constructor MyClass()
|
||||||
|
private final fun callTryConvertConstant(): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public abstract fun </*0*/ P1> foo(): (P1) -> [Error type: Unresolved type for Unknown<String>]<kotlin.String>
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
Generated
+6
@@ -13362,6 +13362,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedOperation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unresolvedTypeWithTypeArguments.kt")
|
||||||
|
public void testUnresolvedTypeWithTypeArguments() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/incompleteCode/unresolvedTypeWithTypeArguments.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("variableDeclarationInSelector.kt")
|
@TestMetadata("variableDeclarationInSelector.kt")
|
||||||
public void testVariableDeclarationInSelector() throws Exception {
|
public void testVariableDeclarationInSelector() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user