AA: take into account type arguments if available
...when computing receiver type for double colon expression
This commit is contained in:
committed by
Space Team
parent
2429d09edd
commit
42e8245007
+4
-2
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.analysis.api.fir.components
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.components.KtBuiltinTypes
|
||||
import org.jetbrains.kotlin.analysis.api.components.KtTypeProvider
|
||||
import org.jetbrains.kotlin.analysis.api.components.buildClassType
|
||||
import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirNamedClassOrObjectSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirSymbol
|
||||
@@ -197,7 +196,10 @@ internal class KtFirTypeProvider(
|
||||
explicitReceiver.resolvedType.asKtType()
|
||||
}
|
||||
is FirResolvedQualifier -> {
|
||||
explicitReceiver.classId?.let { analysisSession.buildClassType(it) }
|
||||
explicitReceiver.symbol?.toLookupTag()?.constructType(
|
||||
explicitReceiver.typeArguments.map { it.toConeTypeProjection() }.toTypedArray(),
|
||||
isNullable = false
|
||||
)?.asKtType()
|
||||
?: fir.resolvedType.getReceiverOfReflectionType()?.asKtType()
|
||||
}
|
||||
else -> {
|
||||
|
||||
+12
@@ -76,6 +76,18 @@ public class FirIdeDependentAnalysisSourceModuleDoubleColonReceiverTypeTestGener
|
||||
runTest("analysis/analysis-api/testData/components/typeInfoProvider/doubleColonReceiverType/methodReference_type.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("methodReference_typeArgument.kt")
|
||||
public void testMethodReference_typeArgument() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/typeInfoProvider/doubleColonReceiverType/methodReference_typeArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("methodReference_typeArgument_startProjection.kt")
|
||||
public void testMethodReference_typeArgument_startProjection() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/typeInfoProvider/doubleColonReceiverType/methodReference_typeArgument_startProjection.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("methodReference_variable.kt")
|
||||
public void testMethodReference_variable() throws Exception {
|
||||
|
||||
+12
@@ -76,6 +76,18 @@ public class FirIdeNormalAnalysisSourceModuleDoubleColonReceiverTypeTestGenerate
|
||||
runTest("analysis/analysis-api/testData/components/typeInfoProvider/doubleColonReceiverType/methodReference_type.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("methodReference_typeArgument.kt")
|
||||
public void testMethodReference_typeArgument() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/typeInfoProvider/doubleColonReceiverType/methodReference_typeArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("methodReference_typeArgument_startProjection.kt")
|
||||
public void testMethodReference_typeArgument_startProjection() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/components/typeInfoProvider/doubleColonReceiverType/methodReference_typeArgument_startProjection.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("methodReference_variable.kt")
|
||||
public void testMethodReference_variable() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user