KTIJ-26423 [AA] Ignore artificial Array type from varargs parameters in KtFirImportOptimizer

This commit is contained in:
Roman Golyshev
2023-10-24 18:24:46 +02:00
committed by teamcity
parent ef31eeae52
commit bd92224aec
2 changed files with 8 additions and 4 deletions
@@ -519,7 +519,14 @@ private sealed interface TypeQualifier {
private val FirResolvedTypeRef.isPresentInSource: Boolean
get() = when (source?.kind) {
is KtRealSourceElementKind -> true
is KtRealSourceElementKind -> {
val isArrayFromVararg = delegatedTypeRef?.source?.kind is KtFakeSourceElementKind.ArrayTypeFromVarargParameter;
// type ref with delegated type ref with such source kind is NOT directly present in the source, so we ignore it
!isArrayFromVararg
}
// type ref with such source kind is explicitly present in the source, so we want to see it
is KtFakeSourceElementKind.ArrayTypeFromVarargParameter -> true
else -> false
@@ -3,7 +3,4 @@ USED DECLARATIONS:
Declaration: dependency.Bar
By names: [Bar]
Declaration: kotlin.Array
By names: [Bar]
UNRESOLVED NAMES: