[FIR] KT-56212 Fix compilation exception caused by type parameter chain

- `FirTypeResolverImpl.resolveSymbol` cannot simply assert that a type
  parameter only has a single qualifier, because code may be fed to the
  compiler where a type parameter is the start of a type chain (see for
  example the added `typeParameterChainInReturnType` test).
- The fix assumes that any multi-qualifier type parameter trivially
  resolves to `null`, because such a chained type cannot exist.

^KT-56212 fixed
^KTIJ-24083 fixed
This commit is contained in:
Marco Pennekamp
2023-01-26 14:08:13 +01:00
committed by Space Team
parent 70ace38788
commit d8671422b1
11 changed files with 63 additions and 4 deletions
@@ -33182,6 +33182,18 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/typeParameters/typeMismatchErrorHasExpectedGenericTypeArgumentInsteadOfTypeParameter.kt");
}
@Test
@TestMetadata("typeParameterChainInReceiver.kt")
public void testTypeParameterChainInReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/typeParameterChainInReceiver.kt");
}
@Test
@TestMetadata("typeParameterChainInReturnType.kt")
public void testTypeParameterChainInReturnType() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/typeParameterChainInReturnType.kt");
}
@Test
@TestMetadata("upperBoundCannotBeArray.kt")
public void testUpperBoundCannotBeArray() throws Exception {
@@ -33086,6 +33086,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/tests/typeParameters/typeMismatchErrorHasExpectedGenericTypeArgumentInsteadOfTypeParameter.kt");
}
@Test
@TestMetadata("typeParameterChainInReceiver.kt")
public void testTypeParameterChainInReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/typeParameterChainInReceiver.kt");
}
@Test
@TestMetadata("typeParameterChainInReturnType.kt")
public void testTypeParameterChainInReturnType() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/typeParameterChainInReturnType.kt");
}
@Test
@TestMetadata("upperBoundCannotBeArray.kt")
public void testUpperBoundCannotBeArray() throws Exception {