[FIR] Properly assign <local> packages to symbols
This prevents `FirConflictsExpressionChecker.kt` from missing conflicting local functions. It used to due to inconsistencies in assigning `<local>`, and this commit makes it a bit more straightforward. The change in KtClassTypeQualifierRenderer prevents `FirOverrideImplementTest.testLocalClass` from failing in `intellij`. It didn't fail for callables, because `KtCallableSignatureRenderer` doesn't try to render packages. ^KT-59186 Fixed
This commit is contained in:
committed by
Space Team
parent
cf655fd5ad
commit
f9c6af4d2a
+2
-1
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.analysis.api.types.KtClassTypeQualifier
|
||||
import org.jetbrains.kotlin.analysis.api.types.KtNonErrorClassType
|
||||
import org.jetbrains.kotlin.analysis.api.types.KtType
|
||||
import org.jetbrains.kotlin.analysis.utils.printer.PrettyPrinter
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
import org.jetbrains.kotlin.renderer.render
|
||||
|
||||
public interface KtClassTypeQualifierRenderer {
|
||||
@@ -37,7 +38,7 @@ public interface KtClassTypeQualifierRenderer {
|
||||
override fun renderClassTypeQualifier(type: KtClassType, printer: PrettyPrinter): Unit = printer {
|
||||
".".separated(
|
||||
{
|
||||
if (type is KtNonErrorClassType) {
|
||||
if (type is KtNonErrorClassType && type.classId.packageFqName != CallableId.PACKAGE_FQ_NAME_FOR_LOCAL) {
|
||||
append(type.classId.packageFqName.render())
|
||||
}
|
||||
},
|
||||
|
||||
Vendored
+4
-3
@@ -3,7 +3,7 @@ implicit receivers:
|
||||
type: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: Y
|
||||
type: <local>/Y
|
||||
owner symbol: KtFirNamedClassOrObjectSymbol
|
||||
|
||||
scopes:
|
||||
@@ -257,7 +257,7 @@ scopes:
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: Y
|
||||
type: <local>/Y
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
@@ -386,4 +386,5 @@ scopes:
|
||||
|
||||
DefaultSimpleImportingScope, index = 10
|
||||
|
||||
DefaultStarImportingScope, index = 11
|
||||
DefaultStarImportingScope, index = 11
|
||||
|
||||
|
||||
+1
-1
@@ -469,7 +469,7 @@ KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
type: T
|
||||
]
|
||||
type: X.U.X<T, T4, T3, T>
|
||||
type: <local>/U.X<T, T4, T3, T>
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
|
||||
+4
-4
@@ -100,7 +100,7 @@ KtTypeAliasSymbol:
|
||||
isExpect: false
|
||||
name: LocalTypeAlias
|
||||
origin: SOURCE
|
||||
symbolKind: CLASS_MEMBER
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
@@ -144,7 +144,7 @@ KtTypeAliasSymbol:
|
||||
isExpect: false
|
||||
name: LocalTypeAlias
|
||||
origin: SOURCE
|
||||
symbolKind: CLASS_MEMBER
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
@@ -204,7 +204,7 @@ KtFunctionSymbol:
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: A.LocalClass.LocalClass
|
||||
type: <local>/LocalClass
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
@@ -269,7 +269,7 @@ KtFunctionSymbol:
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: A.LocalClass
|
||||
type: <local>/LocalClass
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -29,6 +29,6 @@ KtFunctionSymbol:
|
||||
getDispatchReceiver(): KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/Base<Outer>
|
||||
type: <local>/Base<Outer>
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
annotationsList: []
|
||||
classId: A.B
|
||||
classId: <local>/B
|
||||
classSymbol: KtNamedClassOrObjectSymbol(<local>/B)
|
||||
nullability: NON_NULLABLE
|
||||
ownTypeArguments: []
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
annotationsList: []
|
||||
classId: A.B
|
||||
classId: <local>/B
|
||||
classSymbol: KtNamedClassOrObjectSymbol(<local>/B)
|
||||
nullability: NON_NULLABLE
|
||||
ownTypeArguments: [
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
annotationsList: []
|
||||
classId: A.B.C
|
||||
classId: <local>/B.C
|
||||
classSymbol: KtNamedClassOrObjectSymbol(<local>/C)
|
||||
nullability: NON_NULLABLE
|
||||
ownTypeArguments: []
|
||||
|
||||
Reference in New Issue
Block a user