KT-60957 [Analysis API] Properly handle source PSI for implicit invoke calls in KtFirReferenceShortener

For implicit invoke operator calls, there are two instances of
`FirResolvedNamedReference`. One of them references `invoke` function
and cannot be used to analyze the property access, and the second one
has `source == null`. Luckily, the parent of the second reference is
`FirPropertyAccessExpression`, which has the correct source

^KT-60957 Fixed
This commit is contained in:
Roman Golyshev
2023-08-07 23:24:57 +02:00
committed by teamcity
parent 7633e6e6f1
commit 93124ee98c
5 changed files with 48 additions and 1 deletions
@@ -460,6 +460,12 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceShortenerTestGenera
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/variableAssignment_plusOperator.kt");
}
@Test
@TestMetadata("variable_invokeOperator.kt")
public void testVariable_invokeOperator() throws Exception {
runTest("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/variable_invokeOperator.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/referenceShortener/referenceShortener/nestedClasses")
@TestDataPath("$PROJECT_ROOT")