KT-64186 [LL] Correctly handle anonymous objects' headers in ContextCollector

This bug spilled into reference shortener, and then to
"redundant qualifier inspection" and code completion from there;
it caused KTIJ-26024 to reproduce again (but only for anonymous objects)

^KT-64186 Fixed
This commit is contained in:
Roman Golyshev
2023-12-07 23:42:51 +01:00
committed by Space Team
parent 2eb1e65bbf
commit 78f492394c
16 changed files with 231 additions and 1 deletions
@@ -0,0 +1,9 @@
package test
open class Base(param: Nested) {
class Nested
}
val property: Base.Nested = Base.Nested()
val child = object : Base(<expr>property</expr>) {}
@@ -0,0 +1,43 @@
Tower Data Context:
Element 0
Scope: FirDefaultStarImportingScope
Element 1
Scope: FirExplicitStarImportingScope
Element 2
Scope: FirDefaultSimpleImportingScope
Element 3
Scope: FirDefaultSimpleImportingScope
Element 4
Scope: FirPackageMemberScope
Element 5
Scope: FirExplicitSimpleImportingScope
Element 6
Scope: FirNestedClassifierScopeWithSubstitution
Classifiers:
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
FILE: [ResolvedTo(IMPORTS)] superTypeCallArgumentsExpression_objectLiteral.kt
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
public [ResolvedTo(STATUS)] constructor([ResolvedTo(STATUS)] param: R|test/Base.Nested|): R|test/Base| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
LAZY_super<R|kotlin/Any|>
}
}
}
public final [ResolvedTo(CONTRACTS)] val property: R|test/Base.Nested| = Base#.Nested#()
public [ResolvedTo(CONTRACTS)] get(): R|test/Base.Nested|
public final [ResolvedTo(BODY_RESOLVE)] val child: R|test/Base| = object : R|test/Base| {
private [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/<anonymous>| {
super<R|test/Base|>(R|test/property|)
}
}
public [ResolvedTo(BODY_RESOLVE)] get(): R|test/Base|
@@ -0,0 +1,7 @@
package test
open class Base {
class Nested
}
val child = object : <expr>Base</expr>() {}
@@ -0,0 +1,36 @@
Tower Data Context:
Element 0
Scope: FirDefaultStarImportingScope
Element 1
Scope: FirExplicitStarImportingScope
Element 2
Scope: FirDefaultSimpleImportingScope
Element 3
Scope: FirDefaultSimpleImportingScope
Element 4
Scope: FirPackageMemberScope
Element 5
Scope: FirExplicitSimpleImportingScope
FILE: [ResolvedTo(IMPORTS)] superTypeCallee_objectLiteral.kt
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
public [ResolvedTo(STATUS)] constructor(): R|test/Base| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
LAZY_super<R|kotlin/Any|>
}
}
}
public final [ResolvedTo(BODY_RESOLVE)] val child: R|test/Base| = object : R|test/Base| {
private [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/<anonymous>| {
super<R|test/Base|>()
}
}
public [ResolvedTo(BODY_RESOLVE)] get(): R|test/Base|