[AA] KtTypeInfoProvider: introduce fullyExpandedType extension
^KTIJ-23547 ^KTIJ-24141
This commit is contained in:
committed by
Space Team
parent
8ce4c4eba9
commit
09a77d261d
+4
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeToken
|
||||
import org.jetbrains.kotlin.analysis.api.types.KtType
|
||||
import org.jetbrains.kotlin.builtins.functions.FunctionClassKind
|
||||
import org.jetbrains.kotlin.fir.resolve.FirSamResolver
|
||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
|
||||
internal class KtFirTypeInfoProvider(
|
||||
@@ -55,4 +56,6 @@ internal class KtFirTypeInfoProvider(
|
||||
require(type is KtFirType)
|
||||
return type.coneType.arrayElementType()?.isArrayOrPrimitiveArray == true
|
||||
}
|
||||
|
||||
override fun fullyExpandedType(type: KtType): KtType = type.coneType.fullyExpandedType(analysisSession.useSiteSession).asKtType()
|
||||
}
|
||||
|
||||
+12
@@ -46,6 +46,18 @@ public class FirIdeNormalAnalysisSourceModuleSingleSymbolByPsiGenerated extends
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/singleSymbolByPsi"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExpandedParameterType.kt")
|
||||
public void testExpandedParameterType() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/ExpandedParameterType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExpandedReturnType.kt")
|
||||
public void testExpandedReturnType() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/symbols/singleSymbolByPsi/ExpandedReturnType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionWithReceiverAnnotation.kt")
|
||||
public void testFunctionWithReceiverAnnotation() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user