[AA FIR] fix exception from vararg parameter with invalid type

It is true that for vararg parameter `arrayElementType` always have to
be not null, but it required resolution to TYPES phase. But in case of
the error type, the type reference is treated as resolved, so we are not
obligatory to resolve such reference to TYPES, because we already have
the resolved type.
So we can make the rule of KtFirValueParameterSymbol#returnType less
strict, and varargElementType will effectively do the same as
lazy resolve + arrayElementType

^KT-61422 Fixed
This commit is contained in:
Dmitrii Gridin
2023-08-23 17:25:56 +02:00
parent 6e4d033f89
commit 2f8a64fff2
21 changed files with 255 additions and 10 deletions
@@ -364,5 +364,17 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByPsiTestGenerated ext
public void testParameterNotFunctionalType() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/valueParameters/parameterNotFunctionalType.kt");
}
@Test
@TestMetadata("vararg.kt")
public void testVararg() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/valueParameters/vararg.kt");
}
@Test
@TestMetadata("varargWithoutType.kt")
public void testVarargWithoutType() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/valueParameters/varargWithoutType.kt");
}
}
}