[FIR IDE] Fix lazy resolve for local declarations
This commit is contained in:
+8
-8
@@ -151,7 +151,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
60 [label="Enter block"];
|
60 [label="Enter block"];
|
||||||
61 [label="Access variable R|<local>/b|"];
|
61 [label="Access variable R|<local>/b|"];
|
||||||
62 [label="Access variable R|kotlin/String.length|"];
|
62 [label="Access variable R|kotlin/String.length|"];
|
||||||
63 [label="Function call: this@R|/A|.R|/A.bar|()"];
|
63 [label="Function call: this@R|/A|.R|<local>/bar|()"];
|
||||||
64 [label="Exit block"];
|
64 [label="Exit block"];
|
||||||
}
|
}
|
||||||
65 [label="Exit when branch result"];
|
65 [label="Exit when branch result"];
|
||||||
@@ -168,7 +168,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
^ when () {
|
^ when () {
|
||||||
(R|<local>/b| is R|kotlin/String|) -> {
|
(R|<local>/b| is R|kotlin/String|) -> {
|
||||||
R|<local>/b|.R|kotlin/String.length|
|
R|<local>/b|.R|kotlin/String.length|
|
||||||
this@R|/A|.R|/A.bar|()
|
this@R|/A|.R|<local>/bar|()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Int(1)
|
Int(1)
|
||||||
@@ -238,7 +238,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
81 [label="Access variable <Unresolved name: length>#"];
|
81 [label="Access variable <Unresolved name: length>#"];
|
||||||
82 [label="Access variable R|<local>/a|"];
|
82 [label="Access variable R|<local>/a|"];
|
||||||
83 [label="Access variable R|kotlin/String.length|"];
|
83 [label="Access variable R|kotlin/String.length|"];
|
||||||
84 [label="Function call: this@R|/A|.R|/A.baz|()"];
|
84 [label="Function call: this@R|/A|.R|<local>/baz|()"];
|
||||||
85 [label="Exit block"];
|
85 [label="Exit block"];
|
||||||
}
|
}
|
||||||
86 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
|
86 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
|
||||||
@@ -248,7 +248,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
74 [label="Jump: ^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
74 [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>/b|.<Unresolved name: length>#
|
||||||
R|<local>/a|.R|kotlin/String.length|
|
R|<local>/a|.R|kotlin/String.length|
|
||||||
^ this@R|/A|.R|/A.baz|()
|
^ this@R|/A|.R|<local>/baz|()
|
||||||
}
|
}
|
||||||
)"];
|
)"];
|
||||||
75 [label="Stub" style="filled" fillcolor=gray];
|
75 [label="Stub" style="filled" fillcolor=gray];
|
||||||
@@ -352,7 +352,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
123 [label="Enter block"];
|
123 [label="Enter block"];
|
||||||
124 [label="Access variable R|<local>/b|"];
|
124 [label="Access variable R|<local>/b|"];
|
||||||
125 [label="Access variable R|kotlin/String.length|"];
|
125 [label="Access variable R|kotlin/String.length|"];
|
||||||
126 [label="Function call: this@R|/<anonymous>|.R|/<anonymous>.bar|()"];
|
126 [label="Function call: this@R|/<anonymous>|.R|<local>/bar|()"];
|
||||||
127 [label="Exit block"];
|
127 [label="Exit block"];
|
||||||
}
|
}
|
||||||
128 [label="Exit when branch result"];
|
128 [label="Exit when branch result"];
|
||||||
@@ -369,7 +369,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
^ when () {
|
^ when () {
|
||||||
(R|<local>/b| is R|kotlin/String|) -> {
|
(R|<local>/b| is R|kotlin/String|) -> {
|
||||||
R|<local>/b|.R|kotlin/String.length|
|
R|<local>/b|.R|kotlin/String.length|
|
||||||
this@R|/<anonymous>|.R|/<anonymous>.bar|()
|
this@R|/<anonymous>|.R|<local>/bar|()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Int(1)
|
Int(1)
|
||||||
@@ -439,7 +439,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
144 [label="Access variable R|kotlin/String.length|"];
|
144 [label="Access variable R|kotlin/String.length|"];
|
||||||
145 [label="Access variable R|<local>/b|"];
|
145 [label="Access variable R|<local>/b|"];
|
||||||
146 [label="Access variable <Unresolved name: length>#"];
|
146 [label="Access variable <Unresolved name: length>#"];
|
||||||
147 [label="Function call: this@R|/<anonymous>|.R|/<anonymous>.baz|()"];
|
147 [label="Function call: this@R|/<anonymous>|.R|<local>/baz|()"];
|
||||||
148 [label="Exit block"];
|
148 [label="Exit block"];
|
||||||
}
|
}
|
||||||
149 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
|
149 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
|
||||||
@@ -449,7 +449,7 @@ digraph localClassesWithImplicit_kt {
|
|||||||
137 [label="Jump: ^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
137 [label="Jump: ^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
||||||
R|<local>/a|.R|kotlin/String.length|
|
R|<local>/a|.R|kotlin/String.length|
|
||||||
R|<local>/b|.<Unresolved name: length>#
|
R|<local>/b|.<Unresolved name: length>#
|
||||||
^ this@R|/<anonymous>|.R|/<anonymous>.baz|()
|
^ this@R|/<anonymous>|.R|<local>/baz|()
|
||||||
}
|
}
|
||||||
)"];
|
)"];
|
||||||
138 [label="Stub" style="filled" fillcolor=gray];
|
138 [label="Stub" style="filled" fillcolor=gray];
|
||||||
|
|||||||
+4
-4
@@ -20,7 +20,7 @@ FILE: localClassesWithImplicit.kt
|
|||||||
^ when () {
|
^ when () {
|
||||||
(R|<local>/b| is R|kotlin/String|) -> {
|
(R|<local>/b| is R|kotlin/String|) -> {
|
||||||
R|<local>/b|.R|kotlin/String.length|
|
R|<local>/b|.R|kotlin/String.length|
|
||||||
this@R|/A|.R|/A.bar|()
|
this@R|/A|.R|<local>/bar|()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Int(1)
|
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> {
|
^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>/b|.<Unresolved name: length>#
|
||||||
R|<local>/a|.R|kotlin/String.length|
|
R|<local>/a|.R|kotlin/String.length|
|
||||||
^ this@R|/A|.R|/A.baz|()
|
^ this@R|/A|.R|<local>/baz|()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ FILE: localClassesWithImplicit.kt
|
|||||||
^ when () {
|
^ when () {
|
||||||
(R|<local>/b| is R|kotlin/String|) -> {
|
(R|<local>/b| is R|kotlin/String|) -> {
|
||||||
R|<local>/b|.R|kotlin/String.length|
|
R|<local>/b|.R|kotlin/String.length|
|
||||||
this@R|/<anonymous>|.R|/<anonymous>.bar|()
|
this@R|/<anonymous>|.R|<local>/bar|()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Int(1)
|
Int(1)
|
||||||
@@ -72,7 +72,7 @@ FILE: localClassesWithImplicit.kt
|
|||||||
^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
^bar R|/myRun|<R|kotlin/Int|>(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=UNKNOWN> {
|
||||||
R|<local>/a|.R|kotlin/String.length|
|
R|<local>/a|.R|kotlin/String.length|
|
||||||
R|<local>/b|.<Unresolved name: length>#
|
R|<local>/b|.<Unresolved name: length>#
|
||||||
^ this@R|/<anonymous>|.R|/<anonymous>.baz|()
|
^ this@R|/<anonymous>|.R|<local>/baz|()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -57,12 +57,12 @@ FILE: CallBasedInExpressionGenerator.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final override fun putSelector(type: R|org/jetbrains/kotlin/codegen/range/inExpression/Type|, kotlinType: R|org/jetbrains/kotlin/codegen/range/inExpression/KotlinType?|, v: R|org/jetbrains/kotlin/codegen/range/inExpression/InstructionAdapter|): R|kotlin/Unit| {
|
public final override fun putSelector(type: R|org/jetbrains/kotlin/codegen/range/inExpression/Type|, kotlinType: R|org/jetbrains/kotlin/codegen/range/inExpression/KotlinType?|, v: R|org/jetbrains/kotlin/codegen/range/inExpression/InstructionAdapter|): R|kotlin/Unit| {
|
||||||
this@R|/<anonymous>|.R|/<anonymous>.invokeFunction|(R|<local>/v|)
|
this@R|/<anonymous>|.R|<local>/invokeFunction|(R|<local>/v|)
|
||||||
<Unresolved name: coerceTo>#(R|<local>/type|, R|<local>/kotlinType|, R|<local>/v|)
|
<Unresolved name: coerceTo>#(R|<local>/type|, R|<local>/kotlinType|, R|<local>/v|)
|
||||||
}
|
}
|
||||||
|
|
||||||
public final override fun condJump(jumpLabel: R|org/jetbrains/kotlin/codegen/range/inExpression/Label|, v: R|org/jetbrains/kotlin/codegen/range/inExpression/InstructionAdapter|, jumpIfFalse: R|kotlin/Boolean|): R|kotlin/Unit| {
|
public final override fun condJump(jumpLabel: R|org/jetbrains/kotlin/codegen/range/inExpression/Label|, v: R|org/jetbrains/kotlin/codegen/range/inExpression/InstructionAdapter|, jumpIfFalse: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||||
this@R|/<anonymous>|.R|/<anonymous>.invokeFunction|(R|<local>/v|)
|
this@R|/<anonymous>|.R|<local>/invokeFunction|(R|<local>/v|)
|
||||||
R|<local>/v|.<Unresolved name: visitJumpInsn>#(when () {
|
R|<local>/v|.<Unresolved name: visitJumpInsn>#(when () {
|
||||||
R|<local>/jumpIfFalse| -> {
|
R|<local>/jumpIfFalse| -> {
|
||||||
<Unresolved name: Opcodes>#.<Unresolved name: IFEQ>#
|
<Unresolved name: Opcodes>#.<Unresolved name: IFEQ>#
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ FILE: localImplicitBodies.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final fun sss(): R|kotlin/Int| {
|
public final fun sss(): R|kotlin/Int| {
|
||||||
^sss this@R|/<anonymous>|.R|/<anonymous>.abc|()
|
^sss this@R|/<anonymous>|.R|<local>/abc|()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun abc(): R|kotlin/Int| {
|
public final fun abc(): R|kotlin/Int| {
|
||||||
@@ -15,5 +15,5 @@ FILE: localImplicitBodies.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lval g: R|kotlin/Int| = R|<local>/x|.R|/<anonymous>.sss|()
|
lval g: R|kotlin/Int| = R|<local>/x|.R|<local>/sss|()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ FILE: localObjects.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q|B|.R|/B.foo|()
|
Q|B|.R|<local>/foo|()
|
||||||
}
|
}
|
||||||
public final val bb: <ERROR TYPE REF: Unresolved name: foo> = <Unresolved name: B>#.<Unresolved name: foo>#()
|
public final val bb: <ERROR TYPE REF: Unresolved name: foo> = <Unresolved name: B>#.<Unresolved name: foo>#()
|
||||||
public get(): <ERROR TYPE REF: Unresolved name: foo>
|
public get(): <ERROR TYPE REF: Unresolved name: foo>
|
||||||
|
|||||||
+4
-4
@@ -20,7 +20,7 @@ FILE: localScopes.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
lval base: R|BaseLocal| = R|/BaseLocal.BaseLocal|()
|
lval base: R|BaseLocal| = R|/BaseLocal.BaseLocal|()
|
||||||
R|<local>/base|.R|/BaseLocal.baz|()
|
R|<local>/base|.R|<local>/baz|()
|
||||||
R|<local>/base|.R|/Bar.foo|()
|
R|<local>/base|.R|/Bar.foo|()
|
||||||
lval anonymous: R|<anonymous>| = object : R|Bar| {
|
lval anonymous: R|<anonymous>| = object : R|Bar| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
@@ -32,7 +32,7 @@ FILE: localScopes.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
R|<local>/anonymous|.R|/<anonymous>.baz|()
|
R|<local>/anonymous|.R|<local>/baz|()
|
||||||
R|<local>/anonymous|.R|/Bar.foo|()
|
R|<local>/anonymous|.R|/Bar.foo|()
|
||||||
local final class DerivedLocal : R|BaseLocal| {
|
local final class DerivedLocal : R|BaseLocal| {
|
||||||
public constructor(): R|DerivedLocal| {
|
public constructor(): R|DerivedLocal| {
|
||||||
@@ -45,7 +45,7 @@ FILE: localScopes.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
lval derived: R|DerivedLocal| = R|/DerivedLocal.DerivedLocal|()
|
lval derived: R|DerivedLocal| = R|/DerivedLocal.DerivedLocal|()
|
||||||
R|<local>/derived|.R|/DerivedLocal.gau|()
|
R|<local>/derived|.R|<local>/gau|()
|
||||||
R|<local>/derived|.R|/BaseLocal.baz|()
|
R|<local>/derived|.R|<local>/baz|()
|
||||||
R|<local>/derived|.R|/Bar.foo|()
|
R|<local>/derived|.R|/Bar.foo|()
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -10,11 +10,11 @@ FILE: foo.kt
|
|||||||
private set(value: R|kotlin/Boolean|): R|kotlin/Unit|
|
private set(value: R|kotlin/Boolean|): R|kotlin/Unit|
|
||||||
|
|
||||||
public final fun bar(): R|kotlin/Boolean| {
|
public final fun bar(): R|kotlin/Boolean| {
|
||||||
^bar this@R|/<anonymous>|.R|/<anonymous>.result|.R|kotlin/Boolean.not|()
|
^bar this@R|/<anonymous>|.R|<local>/result|.R|kotlin/Boolean.not|()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final override fun result(): R|kotlin/Boolean| {
|
public final override fun result(): R|kotlin/Boolean| {
|
||||||
^result this@R|/<anonymous>|.R|/<anonymous>.result|
|
^result this@R|/<anonymous>|.R|<local>/result|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -71,7 +71,7 @@ FILE: first.kt
|
|||||||
private final fun bar(): R|kotlin/Unit|
|
private final fun bar(): R|kotlin/Unit|
|
||||||
|
|
||||||
public final fun baz(): R|kotlin/Unit| {
|
public final fun baz(): R|kotlin/Unit| {
|
||||||
this@R|/Local|.R|/Local.bar|()
|
this@R|/Local|.R|<local>/bar|()
|
||||||
this@R|/Local|.R|/Local.Inner.Inner|()
|
this@R|/Local|.R|/Local.Inner.Inner|()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,15 +81,15 @@ FILE: first.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final fun foo(): R|kotlin/Unit| {
|
public final fun foo(): R|kotlin/Unit| {
|
||||||
this@R|/Local|.R|/Local.bar|()
|
this@R|/Local|.R|<local>/bar|()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
R|/Local.Local|().R|/Local.baz|()
|
R|/Local.Local|().R|<local>/baz|()
|
||||||
R|/Local.Local|().<HIDDEN: /Local.bar is invisible>#()
|
R|/Local.Local|().<HIDDEN: <local>/bar is invisible>#()
|
||||||
}
|
}
|
||||||
public final fun test(): R|kotlin/Unit| {
|
public final fun test(): R|kotlin/Unit| {
|
||||||
R|/foo|()
|
R|/foo|()
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ FILE: RedundantVisibilityModifierChecker.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
R|/LocalClass.LocalClass|().R|/LocalClass.foo| = Int(1)
|
R|/LocalClass.LocalClass|().R|<local>/foo| = Int(1)
|
||||||
}
|
}
|
||||||
internal final inline fun internal(): R|kotlin/Unit| {
|
internal final inline fun internal(): R|kotlin/Unit| {
|
||||||
R|/f|()
|
R|/f|()
|
||||||
|
|||||||
Vendored
+1
-1
@@ -14,5 +14,5 @@ FILE: callableReferenceToLocalClass.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
lval datas: R|kotlin/collections/List<Data>| = Null(null)!!
|
lval datas: R|kotlin/collections/List<Data>| = Null(null)!!
|
||||||
lval xs: R|kotlin/collections/List<kotlin/Int>| = R|<local>/datas|.R|/myMap|<R|Data|, R|kotlin/Int|>(Q|Data|::R|/Data.x|)
|
lval xs: R|kotlin/collections/List<kotlin/Int>| = R|<local>/datas|.R|/myMap|<R|Data|, R|kotlin/Int|>(Q|Data|::R|<local>/x|)
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-13
@@ -8,7 +8,7 @@ FILE: implicitInLocalClasses.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||||
^foo this@R|/A|.R|/A.bar|(R|<local>/x|)
|
^foo this@R|/A|.R|<local>/bar|(R|<local>/x|)
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||||
@@ -17,7 +17,7 @@ FILE: implicitInLocalClasses.kt
|
|||||||
|
|
||||||
public final val w: R|kotlin/Boolean|
|
public final val w: R|kotlin/Boolean|
|
||||||
public get(): R|kotlin/Boolean| {
|
public get(): R|kotlin/Boolean| {
|
||||||
^ this@R|/A|.R|/A.z|
|
^ this@R|/A|.R|<local>/z|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final val z: R|kotlin/Boolean|
|
public final val z: R|kotlin/Boolean|
|
||||||
@@ -28,17 +28,17 @@ FILE: implicitInLocalClasses.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
lval a: R|A| = R|/A.A|()
|
lval a: R|A| = R|/A.A|()
|
||||||
R|/useBoolean|(R|<local>/a|.R|/A.foo|(Int(1)))
|
R|/useBoolean|(R|<local>/a|.R|<local>/foo|(Int(1)))
|
||||||
R|/useBoolean|(R|<local>/a|.R|/A.bar|(Int(1)))
|
R|/useBoolean|(R|<local>/a|.R|<local>/bar|(Int(1)))
|
||||||
R|/useBoolean|(R|<local>/a|.R|/A.w|)
|
R|/useBoolean|(R|<local>/a|.R|<local>/w|)
|
||||||
R|/useBoolean|(R|<local>/a|.R|/A.z|)
|
R|/useBoolean|(R|<local>/a|.R|<local>/z|)
|
||||||
local final class B : R|kotlin/Any| {
|
local final class B : R|kotlin/Any| {
|
||||||
public constructor(): R|B| {
|
public constructor(): R|B| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||||
^foo this@R|/B|.R|/B.inner|.R|/B.Inner.w|
|
^foo this@R|/B|.R|<local>/inner|.R|<local>/w|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| {
|
||||||
@@ -55,12 +55,12 @@ FILE: implicitInLocalClasses.kt
|
|||||||
|
|
||||||
public final val w: R|kotlin/Boolean|
|
public final val w: R|kotlin/Boolean|
|
||||||
public get(): R|kotlin/Boolean| {
|
public get(): R|kotlin/Boolean| {
|
||||||
^ this@R|/B.Inner|.R|/B.Inner.z|
|
^ this@R|/B.Inner|.R|<local>/z|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final val z: R|kotlin/Boolean|
|
public final val z: R|kotlin/Boolean|
|
||||||
public get(): R|kotlin/Boolean| {
|
public get(): R|kotlin/Boolean| {
|
||||||
^ this@R|/B|.R|/B.bar|(Int(1))
|
^ this@R|/B|.R|<local>/bar|(Int(1))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -68,8 +68,8 @@ FILE: implicitInLocalClasses.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
lval b: R|B| = R|/B.B|()
|
lval b: R|B| = R|/B.B|()
|
||||||
R|/useBoolean|(R|<local>/b|.R|/B.foo|(Int(1)))
|
R|/useBoolean|(R|<local>/b|.R|<local>/foo|(Int(1)))
|
||||||
R|/useBoolean|(R|<local>/b|.R|/B.bar|(Int(1)))
|
R|/useBoolean|(R|<local>/b|.R|<local>/bar|(Int(1)))
|
||||||
R|/useBoolean|(R|<local>/b|.R|/B.inner|.R|/B.Inner.w|)
|
R|/useBoolean|(R|<local>/b|.R|<local>/inner|.R|<local>/w|)
|
||||||
R|/useBoolean|(R|<local>/b|.R|/B.inner|.R|/B.Inner.z|)
|
R|/useBoolean|(R|<local>/b|.R|<local>/inner|.R|<local>/z|)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,24 +10,24 @@ FILE: objectInnerClass.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final fun R|<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
public final fun R|<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
||||||
lval x: R|B| = this@R|/<anonymous>.Child.zoo|.R|/<anonymous>.Base.property|
|
lval x: R|B| = this@R|<local>/zoo|.R|<local>/property|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun foo(): R|kotlin/Unit| {
|
public final fun foo(): R|kotlin/Unit| {
|
||||||
this@R|/<anonymous>.Child|.R|/<anonymous>.Base.baseFun|()
|
this@R|/<anonymous>.Child|.R|<local>/baseFun|()
|
||||||
lval x: R|B| = this@R|/<anonymous>.Child|.R|/<anonymous>.Base.property|
|
lval x: R|B| = this@R|/<anonymous>.Child|.R|<local>/property|
|
||||||
(this@R|/<anonymous>.Child|, this@R|/<anonymous>.Child|).R|/<anonymous>.Child.zoo|()
|
(this@R|/<anonymous>.Child|, this@R|/<anonymous>.Child|).R|<local>/zoo|()
|
||||||
(this@R|/<anonymous>|, this@R|/<anonymous>.Child|).R|/<anonymous>.hoo|()
|
(this@R|/<anonymous>|, this@R|/<anonymous>.Child|).R|/<anonymous>.hoo|()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun R|<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
public final fun R|<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
||||||
lval x: R|B| = this@R|/<anonymous>.voo|.R|/<anonymous>.Base.property|
|
lval x: R|B| = this@R|/<anonymous>.voo|.R|<local>/property|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun R|<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
public final fun R|<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
||||||
lval x: R|B| = this@R|/<anonymous>.hoo|.R|/<anonymous>.Base.property|
|
lval x: R|B| = this@R|/<anonymous>.hoo|.R|<local>/property|
|
||||||
}
|
}
|
||||||
|
|
||||||
local open inner class Base : R|kotlin/Any| {
|
local open inner class Base : R|kotlin/Any| {
|
||||||
@@ -45,16 +45,16 @@ FILE: objectInnerClass.kt
|
|||||||
|
|
||||||
public final fun caseForBase(): R|kotlin/Unit| {
|
public final fun caseForBase(): R|kotlin/Unit| {
|
||||||
lval base: R|<anonymous>.Base| = this@R|/<anonymous>|.R|/<anonymous>.Base.Base|(R|/B.B|())
|
lval base: R|<anonymous>.Base| = this@R|/<anonymous>|.R|/<anonymous>.Base.Base|(R|/B.B|())
|
||||||
R|<local>/base|.R|/<anonymous>.Base.baseFun|()
|
R|<local>/base|.R|<local>/baseFun|()
|
||||||
R|<local>/base|.R|/<anonymous>.Base.property|
|
R|<local>/base|.R|<local>/property|
|
||||||
(this@R|/<anonymous>|, R|<local>/base|).R|/<anonymous>.hoo|()
|
(this@R|/<anonymous>|, R|<local>/base|).R|/<anonymous>.hoo|()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun caseForChild(): R|kotlin/Unit| {
|
public final fun caseForChild(): R|kotlin/Unit| {
|
||||||
lval child: R|<anonymous>.Child| = this@R|/<anonymous>|.R|/<anonymous>.Child.Child|(R|/B.B|())
|
lval child: R|<anonymous>.Child| = this@R|/<anonymous>|.R|/<anonymous>.Child.Child|(R|/B.B|())
|
||||||
R|<local>/child|.R|/<anonymous>.Base.baseFun|()
|
R|<local>/child|.R|<local>/baseFun|()
|
||||||
R|<local>/child|.R|/<anonymous>.Base.property|
|
R|<local>/child|.R|<local>/property|
|
||||||
R|<local>/child|.R|/<anonymous>.Child.foo|()
|
R|<local>/child|.R|<local>/foo|()
|
||||||
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.hoo|()
|
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.hoo|()
|
||||||
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.voo|()
|
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.voo|()
|
||||||
}
|
}
|
||||||
@@ -135,24 +135,24 @@ FILE: objectInnerClass.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final fun R|Case3.<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
public final fun R|Case3.<anonymous>.Base|.zoo(): R|kotlin/Unit| {
|
||||||
lval x: R|B| = this@R|/Case3.<anonymous>.Child.zoo|.R|/Case3.<anonymous>.Base.property|
|
lval x: R|B| = this@R|<local>/zoo|.R|<local>/property|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun foo(): R|kotlin/Unit| {
|
public final fun foo(): R|kotlin/Unit| {
|
||||||
this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Base.baseFun|()
|
this@R|/Case3.<anonymous>.Child|.R|<local>/baseFun|()
|
||||||
lval x: R|B| = this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Base.property|
|
lval x: R|B| = this@R|/Case3.<anonymous>.Child|.R|<local>/property|
|
||||||
(this@R|/Case3.<anonymous>.Child|, this@R|/Case3.<anonymous>.Child|).R|/Case3.<anonymous>.Child.zoo|()
|
(this@R|/Case3.<anonymous>.Child|, this@R|/Case3.<anonymous>.Child|).R|<local>/zoo|()
|
||||||
(this@R|/<anonymous>|, this@R|/Case3.<anonymous>.Child|).R|/<anonymous>.hoo|()
|
(this@R|/<anonymous>|, this@R|/Case3.<anonymous>.Child|).R|/<anonymous>.hoo|()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun R|Case3.<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
public final fun R|Case3.<anonymous>.Child|.voo(): R|kotlin/Unit| {
|
||||||
lval x: R|B| = this@R|/<anonymous>.voo|.R|/Case3.<anonymous>.Base.property|
|
lval x: R|B| = this@R|/<anonymous>.voo|.R|<local>/property|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun R|Case3.<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
public final fun R|Case3.<anonymous>.Base|.hoo(): R|kotlin/Unit| {
|
||||||
lval x: R|B| = this@R|/<anonymous>.hoo|.R|/Case3.<anonymous>.Base.property|
|
lval x: R|B| = this@R|/<anonymous>.hoo|.R|<local>/property|
|
||||||
}
|
}
|
||||||
|
|
||||||
local open inner class Base : R|kotlin/Any| {
|
local open inner class Base : R|kotlin/Any| {
|
||||||
@@ -170,16 +170,16 @@ FILE: objectInnerClass.kt
|
|||||||
|
|
||||||
public final fun caseForBase(): R|kotlin/Unit| {
|
public final fun caseForBase(): R|kotlin/Unit| {
|
||||||
lval base: R|Case3.<anonymous>.Base| = this@R|/<anonymous>|.R|/Case3.<anonymous>.Base.Base|(R|/B.B|())
|
lval base: R|Case3.<anonymous>.Base| = this@R|/<anonymous>|.R|/Case3.<anonymous>.Base.Base|(R|/B.B|())
|
||||||
R|<local>/base|.R|/Case3.<anonymous>.Base.baseFun|()
|
R|<local>/base|.R|<local>/baseFun|()
|
||||||
R|<local>/base|.R|/Case3.<anonymous>.Base.property|
|
R|<local>/base|.R|<local>/property|
|
||||||
(this@R|/<anonymous>|, R|<local>/base|).R|/<anonymous>.hoo|()
|
(this@R|/<anonymous>|, R|<local>/base|).R|/<anonymous>.hoo|()
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun caseForChild(): R|kotlin/Unit| {
|
public final fun caseForChild(): R|kotlin/Unit| {
|
||||||
lval child: R|Case3.<anonymous>.Child| = this@R|/<anonymous>|.R|/Case3.<anonymous>.Child.Child|(R|/B.B|())
|
lval child: R|Case3.<anonymous>.Child| = this@R|/<anonymous>|.R|/Case3.<anonymous>.Child.Child|(R|/B.B|())
|
||||||
R|<local>/child|.R|/Case3.<anonymous>.Base.baseFun|()
|
R|<local>/child|.R|<local>/baseFun|()
|
||||||
R|<local>/child|.R|/Case3.<anonymous>.Base.property|
|
R|<local>/child|.R|<local>/property|
|
||||||
R|<local>/child|.R|/Case3.<anonymous>.Child.foo|()
|
R|<local>/child|.R|<local>/foo|()
|
||||||
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.hoo|()
|
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.hoo|()
|
||||||
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.voo|()
|
(this@R|/<anonymous>|, R|<local>/child|).R|/<anonymous>.voo|()
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -12,7 +12,7 @@ digraph inAnonymousObject_kt {
|
|||||||
2 [label="Exit anonymous object"];
|
2 [label="Exit anonymous object"];
|
||||||
3 [label="Variable declaration: lval obj: R|<anonymous>|"];
|
3 [label="Variable declaration: lval obj: R|<anonymous>|"];
|
||||||
4 [label="Access variable R|<local>/obj|"];
|
4 [label="Access variable R|<local>/obj|"];
|
||||||
5 [label="Function call: R|<local>/obj|.R|/<anonymous>.run|()"];
|
5 [label="Function call: R|<local>/obj|.R|<local>/run|()"];
|
||||||
6 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
|
6 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
|
||||||
7 [label="Exit block"];
|
7 [label="Exit block"];
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ digraph inAnonymousObject_kt {
|
|||||||
color=blue
|
color=blue
|
||||||
20 [label="Enter block"];
|
20 [label="Enter block"];
|
||||||
21 [label="Access variable R|<local>/b|"];
|
21 [label="Access variable R|<local>/b|"];
|
||||||
22 [label="Assignment: R|/<anonymous>.leaked|"];
|
22 [label="Assignment: R|<local>/leaked|"];
|
||||||
23 [label="Exit block"];
|
23 [label="Exit block"];
|
||||||
}
|
}
|
||||||
24 [label="Exit init block" style="filled" fillcolor=red];
|
24 [label="Exit init block" style="filled" fillcolor=red];
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@ FILE: inAnonymousObject.kt
|
|||||||
public get(): R|kotlin/Any|
|
public get(): R|kotlin/Any|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
this@R|/<anonymous>|.R|/<anonymous>.leaked| = R|<local>/b|
|
this@R|/<anonymous>|.R|<local>/leaked| = R|<local>/b|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final override fun run(): R|kotlin/Unit| {
|
public final override fun run(): R|kotlin/Unit| {
|
||||||
@@ -30,6 +30,6 @@ FILE: inAnonymousObject.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
R|<local>/obj|.R|/<anonymous>.run|()
|
R|<local>/obj|.R|<local>/run|()
|
||||||
R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
|
R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ digraph inLocalClass_kt {
|
|||||||
1 [label="Enter block"];
|
1 [label="Enter block"];
|
||||||
2 [label="Exit local class foo"];
|
2 [label="Exit local class foo"];
|
||||||
3 [label="Function call: R|/LocalClass.LocalClass|()"];
|
3 [label="Function call: R|/LocalClass.LocalClass|()"];
|
||||||
4 [label="Function call: R|/LocalClass.LocalClass|().R|/LocalClass.run|()"];
|
4 [label="Function call: R|/LocalClass.LocalClass|().R|<local>/run|()"];
|
||||||
5 [label="Function call: R|<local>/e|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
|
5 [label="Function call: R|<local>/e|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
|
||||||
6 [label="Exit block"];
|
6 [label="Exit block"];
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ digraph inLocalClass_kt {
|
|||||||
color=blue
|
color=blue
|
||||||
22 [label="Enter block"];
|
22 [label="Enter block"];
|
||||||
23 [label="Access variable R|<local>/c|"];
|
23 [label="Access variable R|<local>/c|"];
|
||||||
24 [label="Assignment: R|/LocalClass.leaked|"];
|
24 [label="Assignment: R|<local>/leaked|"];
|
||||||
25 [label="Exit block"];
|
25 [label="Exit block"];
|
||||||
}
|
}
|
||||||
26 [label="Exit init block" style="filled" fillcolor=red];
|
26 [label="Exit init block" style="filled" fillcolor=red];
|
||||||
|
|||||||
+2
-2
@@ -23,7 +23,7 @@ FILE: inLocalClass.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
this@R|/LocalClass|.R|/LocalClass.leaked| = R|<local>/c|
|
this@R|/LocalClass|.R|<local>/leaked| = R|<local>/c|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final fun run(): R|kotlin/Unit| {
|
public final fun run(): R|kotlin/Unit| {
|
||||||
@@ -32,6 +32,6 @@ FILE: inLocalClass.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
R|/LocalClass.LocalClass|().R|/LocalClass.run|()
|
R|/LocalClass.LocalClass|().R|<local>/run|()
|
||||||
R|<local>/e|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
|
R|<local>/e|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ FILE: anonymousInDelegate.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
^ R|<local>/foo|.R|/<anonymous>.bar|()
|
^ R|<local>/foo|.R|<local>/bar|()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public get(): R|kotlin/Int| {
|
public get(): R|kotlin/Int| {
|
||||||
|
|||||||
+2
-2
@@ -57,12 +57,12 @@ FILE: selfReferenceToCompanionObject.kt
|
|||||||
public get(): R|kotlin/String|
|
public get(): R|kotlin/String|
|
||||||
|
|
||||||
public final val closure2: R|() -> kotlin/String| = fun <anonymous>(): R|kotlin/String| <inline=Unknown> {
|
public final val closure2: R|() -> kotlin/String| = fun <anonymous>(): R|kotlin/String| <inline=Unknown> {
|
||||||
^ this@R|/<anonymous>|.R|/<anonymous>.y|
|
^ this@R|/<anonymous>|.R|<local>/y|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): R|() -> kotlin/String|
|
public get(): R|() -> kotlin/String|
|
||||||
|
|
||||||
public final override val z: R|kotlin/String| = this@R|/<anonymous>|.R|/<anonymous>.closure2|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/String|>|()
|
public final override val z: R|kotlin/String| = this@R|/<anonymous>|.R|<local>/closure2|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/String|>|()
|
||||||
public get(): R|kotlin/String|
|
public get(): R|kotlin/String|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -692,7 +692,7 @@ class DeclarationsConverter(
|
|||||||
)?.let { declarations += it.firConstructor }
|
)?.let { declarations += it.firConstructor }
|
||||||
classBodyNode?.also {
|
classBodyNode?.also {
|
||||||
// Use ANONYMOUS_OBJECT_NAME for the owner class id of enum entry declarations
|
// Use ANONYMOUS_OBJECT_NAME for the owner class id of enum entry declarations
|
||||||
withChildClassName(ANONYMOUS_OBJECT_NAME, isLocal = true) {
|
withChildClassName(ANONYMOUS_OBJECT_NAME, forceLocalContext = true) {
|
||||||
declarations += convertClassBody(it, enumClassWrapper)
|
declarations += convertClassBody(it, enumClassWrapper)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1407,7 +1407,7 @@ class DeclarationsConverter(
|
|||||||
isSuspend = modifiers.hasSuspend()
|
isSuspend = modifiers.hasSuspend()
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol = FirNamedFunctionSymbol(callableIdForName(functionName, isLocal))
|
symbol = FirNamedFunctionSymbol(callableIdForName(functionName))
|
||||||
dispatchReceiverType = currentDispatchReceiverType()
|
dispatchReceiverType = currentDispatchReceiverType()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -787,7 +787,7 @@ open class RawFirBuilder(
|
|||||||
typeParameters
|
typeParameters
|
||||||
)
|
)
|
||||||
// Use ANONYMOUS_OBJECT_NAME for the owner class id for enum entry declarations (see KT-42351)
|
// Use ANONYMOUS_OBJECT_NAME for the owner class id for enum entry declarations (see KT-42351)
|
||||||
withChildClassName(ANONYMOUS_OBJECT_NAME, isLocal = true) {
|
withChildClassName(ANONYMOUS_OBJECT_NAME, forceLocalContext = true) {
|
||||||
for (declaration in ktEnumEntry.declarations) {
|
for (declaration in ktEnumEntry.declarations) {
|
||||||
declarations += declaration.toFirDeclaration(
|
declarations += declaration.toFirDeclaration(
|
||||||
correctedEnumSelfTypeRef,
|
correctedEnumSelfTypeRef,
|
||||||
@@ -816,7 +816,7 @@ open class RawFirBuilder(
|
|||||||
val isLocal = classOrObject.isLocal || classOrObject.getStrictParentOfType<KtEnumEntry>() != null
|
val isLocal = classOrObject.isLocal || classOrObject.getStrictParentOfType<KtEnumEntry>() != null
|
||||||
return withChildClassName(
|
return withChildClassName(
|
||||||
classOrObject.nameAsSafeName,
|
classOrObject.nameAsSafeName,
|
||||||
isLocal = isLocal
|
forceLocalContext = isLocal
|
||||||
) {
|
) {
|
||||||
val classKind = when (classOrObject) {
|
val classKind = when (classOrObject) {
|
||||||
is KtObjectDeclaration -> ClassKind.OBJECT
|
is KtObjectDeclaration -> ClassKind.OBJECT
|
||||||
@@ -1022,7 +1022,7 @@ open class RawFirBuilder(
|
|||||||
receiverTypeRef = receiverType
|
receiverTypeRef = receiverType
|
||||||
name = function.nameAsSafeName
|
name = function.nameAsSafeName
|
||||||
labelName = runIf(!name.isSpecial) { name.identifier }
|
labelName = runIf(!name.isSpecial) { name.identifier }
|
||||||
symbol = FirNamedFunctionSymbol(callableIdForName(function.nameAsSafeName, function.isLocal))
|
symbol = FirNamedFunctionSymbol(callableIdForName(function.nameAsSafeName))
|
||||||
dispatchReceiverType = currentDispatchReceiverType()
|
dispatchReceiverType = currentDispatchReceiverType()
|
||||||
status = FirDeclarationStatusImpl(
|
status = FirDeclarationStatusImpl(
|
||||||
if (function.isLocal) Visibilities.Local else function.visibility,
|
if (function.isLocal) Visibilities.Local else function.visibility,
|
||||||
|
|||||||
+6
-5
@@ -64,11 +64,12 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
|||||||
/**** Class name utils ****/
|
/**** Class name utils ****/
|
||||||
inline fun <T> withChildClassName(
|
inline fun <T> withChildClassName(
|
||||||
name: Name,
|
name: Name,
|
||||||
isLocal: Boolean = context.firFunctionTargets.isNotEmpty(),
|
forceLocalContext: Boolean = false,
|
||||||
l: () -> T
|
l: () -> T
|
||||||
): T {
|
): T {
|
||||||
context.className = context.className.child(name)
|
context.className = context.className.child(name)
|
||||||
context.localBits.add(isLocal)
|
val oldForcedLocalContext = context.forcedLocalContext
|
||||||
|
context.forcedLocalContext = forceLocalContext || context.forcedLocalContext
|
||||||
val dispatchReceiversNumber = context.dispatchReceiverTypesStack.size
|
val dispatchReceiversNumber = context.dispatchReceiverTypesStack.size
|
||||||
return try {
|
return try {
|
||||||
l()
|
l()
|
||||||
@@ -82,7 +83,7 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.className = context.className.parent()
|
context.className = context.className.parent()
|
||||||
context.localBits.removeLast()
|
context.forcedLocalContext = oldForcedLocalContext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,9 +100,9 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun callableIdForName(name: Name, local: Boolean = false) =
|
fun callableIdForName(name: Name) =
|
||||||
when {
|
when {
|
||||||
local -> {
|
context.inLocalContext -> {
|
||||||
val pathFqName =
|
val pathFqName =
|
||||||
context.firFunctionTargets.fold(
|
context.firFunctionTargets.fold(
|
||||||
if (context.className == FqName.ROOT) context.packageFqName else context.currentClassId.asSingleFqName()
|
if (context.className == FqName.ROOT) context.packageFqName else context.currentClassId.asSingleFqName()
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ import org.jetbrains.kotlin.name.Name
|
|||||||
class Context<T> {
|
class Context<T> {
|
||||||
lateinit var packageFqName: FqName
|
lateinit var packageFqName: FqName
|
||||||
var className: FqName = FqName.ROOT
|
var className: FqName = FqName.ROOT
|
||||||
val localBits: MutableList<Boolean> = mutableListOf()
|
var forcedLocalContext: Boolean = false
|
||||||
val currentClassId get() = ClassId(packageFqName, className, localBits.lastOrNull() ?: false)
|
val inLocalContext get() = forcedLocalContext || firFunctionTargets.isNotEmpty()
|
||||||
|
val currentClassId get() = ClassId(packageFqName, className, inLocalContext)
|
||||||
|
|
||||||
val firFunctionTargets = mutableListOf<FirFunctionTarget>()
|
val firFunctionTargets = mutableListOf<FirFunctionTarget>()
|
||||||
val calleeNamesForLambda = mutableListOf<Name>()
|
val calleeNamesForLambda = mutableListOf<Name>()
|
||||||
|
|||||||
+2
-4
@@ -11,11 +11,9 @@ import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
|||||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||||
import org.jetbrains.kotlin.fir.resolve.transformers.FirPhaseManager
|
import org.jetbrains.kotlin.fir.resolve.transformers.FirPhaseManager
|
||||||
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.api.tryCollectDesignation
|
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.ModuleFileCache
|
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.ModuleFileCache
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver
|
import org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.sessions.FirSessionInvalidator
|
import org.jetbrains.kotlin.idea.fir.low.level.api.sessions.FirSessionInvalidator
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.util.isLocalDeclaration
|
|
||||||
|
|
||||||
@ThreadSafeMutableState
|
@ThreadSafeMutableState
|
||||||
internal class IdeFirPhaseManager(
|
internal class IdeFirPhaseManager(
|
||||||
@@ -28,7 +26,6 @@ internal class IdeFirPhaseManager(
|
|||||||
requiredPhase: FirResolvePhase
|
requiredPhase: FirResolvePhase
|
||||||
) {
|
) {
|
||||||
val fir = symbol.fir as FirDeclaration
|
val fir = symbol.fir as FirDeclaration
|
||||||
if (fir.isLocalDeclaration) return
|
|
||||||
try {
|
try {
|
||||||
if (fir.resolvePhase < requiredPhase) { //TODO Make thread safe
|
if (fir.resolvePhase < requiredPhase) { //TODO Make thread safe
|
||||||
lazyDeclarationResolver.lazyResolveDeclaration(
|
lazyDeclarationResolver.lazyResolveDeclaration(
|
||||||
@@ -36,7 +33,8 @@ internal class IdeFirPhaseManager(
|
|||||||
moduleFileCache = cache,
|
moduleFileCache = cache,
|
||||||
scopeSession = ScopeSession(),
|
scopeSession = ScopeSession(),
|
||||||
toPhase = requiredPhase,
|
toPhase = requiredPhase,
|
||||||
checkPCE = true
|
checkPCE = true,
|
||||||
|
skipLocalDeclaration = true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
|||||||
+7
-6
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.renderWithType
|
|||||||
import org.jetbrains.kotlin.fir.resolve.firProvider
|
import org.jetbrains.kotlin.fir.resolve.firProvider
|
||||||
import org.jetbrains.kotlin.fir.resolve.toFirRegularClass
|
import org.jetbrains.kotlin.fir.resolve.toFirRegularClass
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.util.getContainingFile
|
import org.jetbrains.kotlin.idea.fir.low.level.api.util.getContainingFile
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.util.isLocalDeclaration
|
|
||||||
import org.jetbrains.kotlin.idea.util.ifFalse
|
import org.jetbrains.kotlin.idea.util.ifFalse
|
||||||
|
|
||||||
class FirDeclarationDesignationWithFile(
|
class FirDeclarationDesignationWithFile(
|
||||||
@@ -55,14 +54,16 @@ private fun FirRegularClass.collectForNonLocal(): List<FirDeclaration> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun collectDesignationPath(declaration: FirDeclaration): List<FirDeclaration>? {
|
private fun collectDesignationPath(declaration: FirDeclaration): List<FirDeclaration>? {
|
||||||
if (declaration.isLocalDeclaration) return null
|
|
||||||
val containingClass = when (declaration) {
|
val containingClass = when (declaration) {
|
||||||
is FirCallableDeclaration<*> -> {
|
is FirCallableDeclaration<*> -> {
|
||||||
val isLocalMember = (declaration as? FirCallableMemberDeclaration<*>)?.status?.visibility == Visibilities.Local
|
if (declaration.symbol.callableId.isLocal) return null
|
||||||
if (isLocalMember) return null
|
if ((declaration as? FirCallableMemberDeclaration<*>)?.status?.visibility == Visibilities.Local) return null
|
||||||
when (declaration) {
|
when (declaration) {
|
||||||
is FirSimpleFunction, is FirProperty, is FirField, is FirConstructor ->
|
is FirSimpleFunction, is FirProperty, is FirField, is FirConstructor -> {
|
||||||
declaration.containingClass()?.toFirRegularClass(declaration.moduleData.session)
|
val klass = declaration.containingClass() ?: return emptyList()
|
||||||
|
if (klass.classId.isLocal) return null
|
||||||
|
klass.toFirRegularClass(declaration.moduleData.session)
|
||||||
|
}
|
||||||
else -> return null
|
else -> return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-4
@@ -12,6 +12,9 @@ import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
|||||||
import org.jetbrains.kotlin.fir.resolve.transformers.FirImportResolveTransformer
|
import org.jetbrains.kotlin.fir.resolve.transformers.FirImportResolveTransformer
|
||||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirTowerDataContextCollector
|
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirTowerDataContextCollector
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.api.FirDeclarationDesignationWithFile
|
import org.jetbrains.kotlin.idea.fir.low.level.api.api.FirDeclarationDesignationWithFile
|
||||||
|
import org.jetbrains.kotlin.idea.fir.low.level.api.api.collectDesignationWithFile
|
||||||
|
import org.jetbrains.kotlin.idea.fir.low.level.api.api.tryCollectDesignationWithFile
|
||||||
|
import org.jetbrains.kotlin.idea.fir.low.level.api.element.builder.getNonLocalContainingOrThisDeclaration
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.FirFileBuilder
|
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.FirFileBuilder
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.ModuleFileCache
|
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.ModuleFileCache
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.runCustomResolveUnderLock
|
import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.runCustomResolveUnderLock
|
||||||
@@ -22,6 +25,7 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.transformers.FirProviderInter
|
|||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.transformers.LazyTransformerFactory
|
import org.jetbrains.kotlin.idea.fir.low.level.api.transformers.LazyTransformerFactory
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.util.checkCanceled
|
import org.jetbrains.kotlin.idea.fir.low.level.api.util.checkCanceled
|
||||||
import org.jetbrains.kotlin.idea.fir.low.level.api.util.ensurePhase
|
import org.jetbrains.kotlin.idea.fir.low.level.api.util.ensurePhase
|
||||||
|
import org.jetbrains.kotlin.idea.fir.low.level.api.util.findSourceNonLocalFirDeclaration
|
||||||
import org.jetbrains.kotlin.idea.util.ifTrue
|
import org.jetbrains.kotlin.idea.util.ifTrue
|
||||||
|
|
||||||
internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBuilder) {
|
internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBuilder) {
|
||||||
@@ -189,6 +193,7 @@ internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBui
|
|||||||
toPhase: FirResolvePhase,
|
toPhase: FirResolvePhase,
|
||||||
checkPCE: Boolean,
|
checkPCE: Boolean,
|
||||||
declarationPhaseDowngraded: Boolean = false,
|
declarationPhaseDowngraded: Boolean = false,
|
||||||
|
skipLocalDeclaration: Boolean = false,
|
||||||
) {
|
) {
|
||||||
if (toPhase == FirResolvePhase.RAW_FIR) return
|
if (toPhase == FirResolvePhase.RAW_FIR) return
|
||||||
//TODO Should be synchronised
|
//TODO Should be synchronised
|
||||||
@@ -205,10 +210,29 @@ internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBui
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val provider = firDeclarationToResolve.moduleData.session.firIdeProvider
|
val requestedDeclarationDesignation = firDeclarationToResolve.tryCollectDesignationWithFile()
|
||||||
val (designation, forceToBody) =
|
|
||||||
firDeclarationToResolve.getNonLocalDeclarationToResolveAndForceUpgradeToBodyPhase(provider, moduleFileCache, firFileBuilder)
|
val designation: FirDeclarationDesignationWithFile
|
||||||
val neededPhase = if (forceToBody) FirResolvePhase.BODY_RESOLVE else toPhase
|
val neededPhase: FirResolvePhase
|
||||||
|
if (requestedDeclarationDesignation != null) {
|
||||||
|
designation = requestedDeclarationDesignation
|
||||||
|
neededPhase = toPhase
|
||||||
|
} else {
|
||||||
|
val possiblyLocalDeclaration = firDeclarationToResolve.getKtDeclarationForFirElement()
|
||||||
|
val nonLocalDeclaration = possiblyLocalDeclaration.getNonLocalContainingOrThisDeclaration()
|
||||||
|
?: error("Container for local declaration cannot be null")
|
||||||
|
|
||||||
|
val isLocalDeclarationResolveRequested = possiblyLocalDeclaration != nonLocalDeclaration
|
||||||
|
if (isLocalDeclarationResolveRequested && skipLocalDeclaration) return
|
||||||
|
|
||||||
|
val nonLocalFirDeclaration = nonLocalDeclaration.findSourceNonLocalFirDeclaration(
|
||||||
|
firFileBuilder,
|
||||||
|
firDeclarationToResolve.moduleData.session.firIdeProvider.symbolProvider,
|
||||||
|
moduleFileCache
|
||||||
|
)
|
||||||
|
designation = nonLocalFirDeclaration.collectDesignationWithFile()
|
||||||
|
neededPhase = if (isLocalDeclarationResolveRequested) FirResolvePhase.BODY_RESOLVE else toPhase
|
||||||
|
}
|
||||||
|
|
||||||
//TODO Should be synchronised
|
//TODO Should be synchronised
|
||||||
if (!designation.declaration.isValidForResolve()) return
|
if (!designation.declaration.isValidForResolve()) return
|
||||||
|
|||||||
+2
-17
@@ -21,18 +21,9 @@ import org.jetbrains.kotlin.psi.*
|
|||||||
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
|
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||||
|
|
||||||
internal fun FirDeclaration.getNonLocalDeclarationToResolveAndForceUpgradeToBodyPhase(
|
internal fun FirDeclaration.getKtDeclarationForFirElement(): KtDeclaration {
|
||||||
provider: FirProvider,
|
|
||||||
moduleFileCache: ModuleFileCache,
|
|
||||||
firFileBuilder: FirFileBuilder
|
|
||||||
): Pair<FirDeclarationDesignationWithFile, Boolean> {
|
|
||||||
require(this !is FirFile)
|
require(this !is FirFile)
|
||||||
|
|
||||||
val nonLocalDesignation = tryCollectDesignationWithFile()
|
|
||||||
if (nonLocalDesignation != null) {
|
|
||||||
return nonLocalDesignation to false
|
|
||||||
}
|
|
||||||
|
|
||||||
val ktDeclaration = (psi as? KtDeclaration) ?: run {
|
val ktDeclaration = (psi as? KtDeclaration) ?: run {
|
||||||
(source as? FirFakeSourceElement<*>).psi?.parentOfType()
|
(source as? FirFakeSourceElement<*>).psi?.parentOfType()
|
||||||
}
|
}
|
||||||
@@ -61,13 +52,7 @@ internal fun FirDeclaration.getNonLocalDeclarationToResolveAndForceUpgradeToBody
|
|||||||
check(declaration is KtDeclaration) {
|
check(declaration is KtDeclaration) {
|
||||||
"FirDeclaration should have a PSI of type KtDeclaration"
|
"FirDeclaration should have a PSI of type KtDeclaration"
|
||||||
}
|
}
|
||||||
|
return declaration
|
||||||
val nonLocalDeclaration = declaration.getNonLocalContainingOrThisDeclaration()
|
|
||||||
?: error("Container for local declaration cannot be null")
|
|
||||||
|
|
||||||
val firDeclaration = nonLocalDeclaration.findSourceNonLocalFirDeclaration(firFileBuilder, provider.symbolProvider, moduleFileCache)
|
|
||||||
val needUpgrade = nonLocalDeclaration !== declaration
|
|
||||||
return firDeclaration.collectDesignationWithFile() to needUpgrade
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun declarationCanBeLazilyResolved(declaration: KtDeclaration): Boolean {
|
internal fun declarationCanBeLazilyResolved(declaration: KtDeclaration): Boolean {
|
||||||
|
|||||||
+1
-11
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.fir.low.level.api.util
|
package org.jetbrains.kotlin.idea.fir.low.level.api.util
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.*
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
import org.jetbrains.kotlin.fir.psi
|
import org.jetbrains.kotlin.fir.psi
|
||||||
import org.jetbrains.kotlin.fir.realPsi
|
import org.jetbrains.kotlin.fir.realPsi
|
||||||
@@ -125,13 +124,4 @@ private fun KtClassLikeDeclaration.findFir(firSymbolProvider: FirSymbolProvider)
|
|||||||
|
|
||||||
|
|
||||||
val FirDeclaration.isGeneratedDeclaration
|
val FirDeclaration.isGeneratedDeclaration
|
||||||
get() = realPsi == null
|
get() = realPsi == null
|
||||||
|
|
||||||
|
|
||||||
internal val FirDeclaration.isLocalDeclaration: Boolean
|
|
||||||
get() = when (this) {
|
|
||||||
is FirCallableDeclaration<*> ->
|
|
||||||
((this as? FirCallableMemberDeclaration<*>)?.status?.visibility == Visibilities.Local)
|
|
||||||
is FirClassLikeDeclaration<*> -> isLocal
|
|
||||||
else -> true
|
|
||||||
}
|
|
||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
public? final? [BODY_RESOLVE] class E : R|kotlin/Any| {
|
public final [BODY_RESOLVE] class E : R|kotlin/Any| {
|
||||||
public? [BODY_RESOLVE] constructor(): R|E| {
|
public [BODY_RESOLVE] constructor(): R|E| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
public? final? [BODY_RESOLVE] fun e(): R|kotlin/Int| {
|
public final [BODY_RESOLVE] fun e(): R|kotlin/Int| {
|
||||||
^e R|<local>/x|
|
^e R|<local>/x|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
local final? fun <local>/bar(): R|kotlin/Unit| {
|
local final? fun test/locals/Owner.bar(): R|kotlin/Unit| {
|
||||||
baz#(i#, x#)
|
baz#(i#, x#)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user