AA FIR: build argument mapping for SAM conversion node

^KT-64910 fixed
This commit is contained in:
Jinseong Jeon
2024-01-11 22:42:08 -08:00
committed by teamcity
parent d6c9a492ad
commit e91e5db0ce
13 changed files with 390 additions and 1 deletions
@@ -1343,7 +1343,10 @@ internal class KtFirCallResolver(
// For spread, named, and lambda arguments, the source is the KtValueArgument.
// For other arguments (including array indices), the source is the KtExpression.
return when (this) {
is FirSmartCastExpression -> originalExpression.realPsi as? KtExpression
is FirSamConversionExpression ->
expression.realPsi as? KtExpression
is FirSmartCastExpression ->
originalExpression.realPsi as? KtExpression
is FirNamedArgumentExpression, is FirSpreadArgumentExpression, is FirLambdaArgumentExpression ->
realPsi.safeAs<KtValueArgument>()?.getArgumentExpression()
else -> realPsi as? KtExpression
@@ -766,6 +766,30 @@ public class FirIdeNormalAnalysisSourceModuleResolveCallTestGenerated extends Ab
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/samConstructorCall.kt");
}
@Test
@TestMetadata("samFromJava_lambda.kt")
public void testSamFromJava_lambda() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/samFromJava_lambda.kt");
}
@Test
@TestMetadata("samFromJava_methodReference.kt")
public void testSamFromJava_methodReference() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/samFromJava_methodReference.kt");
}
@Test
@TestMetadata("samLambda.kt")
public void testSamLambda() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/samLambda.kt");
}
@Test
@TestMetadata("samMethodReference.kt")
public void testSamMethodReference() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/samMethodReference.kt");
}
@Test
@TestMetadata("simpleCallWithNonMatchingArgs.kt")
public void testSimpleCallWithNonMatchingArgs() throws Exception {