[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
@@ -27,13 +27,13 @@ FILE: inLocalClass.kt
public final val leaked: R|kotlin/Any|
public get(): R|kotlin/Any|
public constructor(): R|LocalClass| {
public constructor(): R|<local>/LocalClass| {
super<R|kotlin/Any|>()
R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
}
init {
this@R|/LocalClass|.R|<local>/leaked| = R|<local>/c|
this@R|<local>/LocalClass|.R|<local>/leaked| = R|<local>/c|
}
public final fun run(): R|kotlin/Unit| {
@@ -39,7 +39,7 @@ FILE: fromLocalMembers.kt
lval x: R|kotlin/Int|
lval y: R|kotlin/Int|
local final class A : R|kotlin/Any| {
public constructor(): R|A| {
public constructor(): R|<local>/A| {
super<R|kotlin/Any|>()
}
@@ -18,7 +18,7 @@ FILE: problems.kt
public get(): R|kotlin/Any|
public final fun test(): R|kotlin/Unit| {
local final class Local : R|kotlin/Any| {
public constructor(): R|Local| {
public constructor(): R|<local>/Local| {
super<R|kotlin/Any|>()
}
@@ -10,7 +10,7 @@ FILE: FieldAnnotationWithClasses.kt
}
public final fun foo(): R|kotlin/Unit| {
local final class Local : R|kotlin/Any| {
public constructor(): R|Local| {
public constructor(): R|<local>/Local| {
super<R|kotlin/Any|>()
}
@@ -38,7 +38,7 @@ FILE: localScopesInAnonymousObject.kt
public get(): R|kotlin/Any|
public final fun owner(): R|kotlin/Unit| {
local final class Local : R|kotlin/Any| {
public constructor(): R|Local| {
public constructor(): R|<local>/Local| {
super<R|kotlin/Any|>()
}
@@ -46,9 +46,9 @@ FILE: localScopesInAnonymousObject.kt
public get(): R|kotlin/String|
private final fun foo(): R|kotlin/Unit| {
^foo R|kotlin/with|<R|kotlin/String|, R|kotlin/Unit|>(this@R|/Local|.R|<local>/someString|, <L> = with@fun R|kotlin/String|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
^foo R|kotlin/with|<R|kotlin/String|, R|kotlin/Unit|>(this@R|<local>/Local|.R|<local>/someString|, <L> = with@fun R|kotlin/String|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
lval presentations: R|kotlin/collections/MutableList<kotlin/String>| = R|kotlin/collections/mutableListOf|<R|kotlin/String|>()
this@R|/Local|.R|<local>/bar|(Boolean(true))?.{ $subj$.R|kotlin/let|<R|kotlin/String|, R|kotlin/Unit|>(<L> = let@fun <anonymous>(it: R|kotlin/String|): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
this@R|<local>/Local|.R|<local>/bar|(Boolean(true))?.{ $subj$.R|kotlin/let|<R|kotlin/String|, R|kotlin/Unit|>(<L> = let@fun <anonymous>(it: R|kotlin/String|): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
R|<local>/presentations|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(R|<local>/it|)
}
) }
@@ -57,7 +57,7 @@ FILE: localScopesInAnonymousObject.kt
}
private final fun bar(arg: R|kotlin/Boolean|): R|kotlin/String?| {
^bar R|kotlin/with|<R|kotlin/String|, R|kotlin/String?|>(this@R|/Local|.R|<local>/someString|, <L> = with@fun R|kotlin/String|.<anonymous>(): R|kotlin/String?| <inline=Inline, kind=EXACTLY_ONCE> {
^bar R|kotlin/with|<R|kotlin/String|, R|kotlin/String?|>(this@R|<local>/Local|.R|<local>/someString|, <L> = with@fun R|kotlin/String|.<anonymous>(): R|kotlin/String?| <inline=Inline, kind=EXACTLY_ONCE> {
^ when () {
R|<local>/arg| -> {
this@R|special/anonymous|