[Analysis API] fix IndexOutOfRangeException

Previously, the `KtFirUsualClassType.qualifiers` was empty for the local classes

The reason was a RawFirBuilder setting up a containingClassForLocalAttr
to the outer non-local class for the local class. It should be a null instead,
see the localClassType.kt as an example

^KT-55510 fixed
This commit is contained in:
Ilya Kirillov
2022-12-16 13:55:29 +01:00
committed by teamcity
parent 61d8b91c89
commit 20b81464be
23 changed files with 396 additions and 38 deletions
@@ -1,2 +1,2 @@
KtType: Foo
KtType: Foo.Bar
PsiType: PsiType:Bar
@@ -0,0 +1,11 @@
annotationsList: []
classId: B
classSymbol: KtNamedClassOrObjectSymbol(<local>/B)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: B
symbol: KtNamedClassOrObjectSymbol(<local>/B)
typeArguments: []
]
@@ -0,0 +1,7 @@
class A {
fun aa() {
class B()
fun cc<caret>c(): B
}
}
@@ -0,0 +1,11 @@
annotationsList: []
classId: A.B
classSymbol: KtNamedClassOrObjectSymbol(<local>/B)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: B
symbol: KtNamedClassOrObjectSymbol(<local>/B)
typeArguments: []
]
@@ -0,0 +1,35 @@
annotationsList: []
classId: B
classSymbol: KtNamedClassOrObjectSymbol(<local>/B)
nullability: NON_NULLABLE
ownTypeArguments: [
annotationsList: []
classId: kotlin/Int
classSymbol: KtNamedClassOrObjectSymbol(kotlin/Int)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: Int
symbol: KtNamedClassOrObjectSymbol(kotlin/Int)
typeArguments: []
]
]
qualifiers: [
qualifier:
name: B
symbol: KtNamedClassOrObjectSymbol(<local>/B)
typeArguments: [
annotationsList: []
classId: kotlin/Int
classSymbol: KtNamedClassOrObjectSymbol(kotlin/Int)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: Int
symbol: KtNamedClassOrObjectSymbol(kotlin/Int)
typeArguments: []
]
]
]
@@ -0,0 +1,7 @@
class A {
fun aa() {
class B<T>()
fun cc<caret>c(): B<Int>
}
}
@@ -0,0 +1,35 @@
annotationsList: []
classId: A.B
classSymbol: KtNamedClassOrObjectSymbol(<local>/B)
nullability: NON_NULLABLE
ownTypeArguments: [
annotationsList: []
classId: kotlin/Int
classSymbol: KtNamedClassOrObjectSymbol(kotlin/Int)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: Int
symbol: KtNamedClassOrObjectSymbol(kotlin/Int)
typeArguments: []
]
]
qualifiers: [
qualifier:
name: B
symbol: KtNamedClassOrObjectSymbol(<local>/B)
typeArguments: [
annotationsList: []
classId: kotlin/Int
classSymbol: KtNamedClassOrObjectSymbol(kotlin/Int)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: Int
symbol: KtNamedClassOrObjectSymbol(kotlin/Int)
typeArguments: []
]
]
]
@@ -0,0 +1,15 @@
annotationsList: []
classId: C
classSymbol: KtNamedClassOrObjectSymbol(<local>/C)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: B
symbol: KtNamedClassOrObjectSymbol(<local>/B)
typeArguments: []
qualifier:
name: C
symbol: KtNamedClassOrObjectSymbol(<local>/C)
typeArguments: []
]
@@ -0,0 +1,9 @@
class A {
fun aa() {
class B {
class C
}
fun cc<caret>c(): B.C
}
}
@@ -0,0 +1,15 @@
annotationsList: []
classId: A.B.C
classSymbol: KtNamedClassOrObjectSymbol(<local>/C)
nullability: NON_NULLABLE
ownTypeArguments: []
qualifiers: [
qualifier:
name: B
symbol: KtNamedClassOrObjectSymbol(<local>/B)
typeArguments: []
qualifier:
name: C
symbol: KtNamedClassOrObjectSymbol(<local>/C)
typeArguments: []
]