[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:
Nikolay Lunyak
2023-08-09 15:18:03 +03:00
committed by Space Team
parent cf655fd5ad
commit f9c6af4d2a
107 changed files with 733 additions and 891 deletions
@@ -13,7 +13,7 @@ FILE: annotatedLocalClass.kt
}
@R|Ann|() local final class Local : R|kotlin/Any| {
public constructor(): R|Local| {
public constructor(): R|<local>/Local| {
super<R|kotlin/Any|>()
}
@@ -5,7 +5,7 @@ FILE: innerClassInAnonymousObject.kt
}
local final class Nested : R|kotlin/Any| {
public constructor(): R|<anonymous>.Nested| {
public constructor(): R|<local>/<anonymous>.Nested| {
super<R|kotlin/Any|>()
}
@@ -239,7 +239,7 @@ digraph localClassesWithImplicit_kt {
115 [label="Access variable R|<local>/a|"];
116 [label="Smart cast: R|<local>/a|"];
117 [label="Access variable R|kotlin/String.length|"];
118 [label="Function call: this@R|/A|.R|<local>/baz|()" style="filled" fillcolor=yellow];
118 [label="Function call: this@R|<local>/A|.R|<local>/baz|()" style="filled" fillcolor=yellow];
119 [label="Exit block"];
}
120 [label="Exit function <anonymous>" style="filled" fillcolor=red];
@@ -249,7 +249,7 @@ digraph localClassesWithImplicit_kt {
123 [label="Jump: ^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
R|<local>/b|.<Unresolved name: length>#
R|<local>/a|.R|kotlin/String.length|
^ this@R|/A|.R|<local>/baz|()
^ this@R|<local>/A|.R|<local>/baz|()
}
)"];
124 [label="Stub" style="filled" fillcolor=gray];
@@ -303,7 +303,7 @@ digraph localClassesWithImplicit_kt {
149 [label="Access variable R|<local>/b|"];
150 [label="Smart cast: R|<local>/b|"];
151 [label="Access variable R|kotlin/String.length|"];
152 [label="Function call: this@R|/A|.R|<local>/bar|()" style="filled" fillcolor=yellow];
152 [label="Function call: this@R|<local>/A|.R|<local>/bar|()" style="filled" fillcolor=yellow];
153 [label="Exit block"];
}
154 [label="Exit when branch result"];
@@ -320,7 +320,7 @@ digraph localClassesWithImplicit_kt {
^ when () {
(R|<local>/b| is R|kotlin/String|) -> {
R|<local>/b|.R|kotlin/String.length|
this@R|/A|.R|<local>/bar|()
this@R|<local>/A|.R|<local>/bar|()
}
else -> {
Int(1)
@@ -10,7 +10,7 @@ FILE: localClassesWithImplicit.kt
}
local final class A : R|kotlin/Any| {
public constructor(): R|A| {
public constructor(): R|<local>/A| {
super<R|kotlin/Any|>()
}
@@ -20,7 +20,7 @@ FILE: localClassesWithImplicit.kt
^ when () {
(R|<local>/b| is R|kotlin/String|) -> {
R|<local>/b|.R|kotlin/String.length|
this@R|/A|.R|<local>/bar|()
this@R|<local>/A|.R|<local>/bar|()
}
else -> {
Int(1)
@@ -35,7 +35,7 @@ FILE: localClassesWithImplicit.kt
^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
R|<local>/b|.<Unresolved name: length>#
R|<local>/a|.R|kotlin/String.length|
^ this@R|/A|.R|<local>/baz|()
^ this@R|<local>/A|.R|<local>/baz|()
}
)
}
@@ -18,7 +18,7 @@ FILE: propertiesAndInitBlocks.kt
}
local final class InitializerLocalClass : R|kotlin/Any| {
public constructor(): R|InitializerLocalClass| {
public constructor(): R|<local>/InitializerLocalClass| {
super<R|kotlin/Any|>()
}
@@ -34,7 +34,7 @@ FILE: propertiesAndInitBlocks.kt
)
public get(): R|kotlin/Unit| {
local final class GetterLocalClass : R|kotlin/Any| {
public constructor(): R|GetterLocalClass| {
public constructor(): R|<local>/GetterLocalClass| {
super<R|kotlin/Any|>()
}