[FIR] Don't store class functions in local scope

This commit is contained in:
Mikhail Glukhikh
2020-04-08 17:26:29 +03:00
parent 19d0d42b9e
commit 14731527ed
6 changed files with 9 additions and 11 deletions
@@ -71,7 +71,7 @@ FILE: first.kt
private final fun bar(): R|kotlin/Unit|
public[local] final fun baz(): R|kotlin/Unit| {
R|/Local.bar|()
this@R|/Local|.R|/Local.bar|()
this@R|/Local|.R|/Local.Inner.Inner|()
}
@@ -81,7 +81,7 @@ FILE: first.kt
}
public[local] final fun foo(): R|kotlin/Unit| {
R|/Local.bar|()
this@R|/Local|.R|/Local.bar|()
}
}
@@ -106,7 +106,7 @@ class Case3() {
fun foo() {
<!UNRESOLVED_REFERENCE!>baseFun<!>() //UNRESOLVED_REFERENCE
val x = <!UNRESOLVED_REFERENCE!>property<!> //UNRESOLVED_REFERENCE
zoo()
<!UNRESOLVED_REFERENCE!>zoo<!>()
hoo()
}
}
@@ -79,7 +79,7 @@ FILE: objectInnerClass.kt
public final fun foo(): R|kotlin/Unit| {
this@R|/anonymous|.R|/Case2.Base.baseFun|()
lval x: R|B| = this@R|/anonymous|.R|/Case2.Base.property|
this@R|/anonymous|.R|/anonymous.zoo|()
(this@R|/anonymous|, this@R|/anonymous|).R|/anonymous.zoo|()
(this@R|/Case2|, this@R|/anonymous|).R|/Case2.hoo|()
}
@@ -141,7 +141,7 @@ FILE: objectInnerClass.kt
public[local] final fun foo(): R|kotlin/Unit| {
<Unresolved name: baseFun>#()
lval x: <ERROR TYPE REF: Unresolved name: property> = <Unresolved name: property>#
this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Child.zoo|()
<Unresolved name: zoo>#()
(this@R|/anonymous|, this@R|/Case3.<anonymous>.Child|).R|/anonymous.hoo|()
}
@@ -172,7 +172,7 @@ FILE: objectInnerClass.kt
lval base: R|Case3.<anonymous>.Base| = R|/Case3.<anonymous>.Base.Base|(R|/B.B|())
R|<local>/base|.<Unresolved name: baseFun>#()
R|<local>/base|.<Unresolved name: property>#
R|<local>/base|.R|/anonymous.hoo|()
(this@R|/anonymous|, R|<local>/base|).R|/anonymous.hoo|()
}
public final fun caseForChild(): R|kotlin/Unit| {
@@ -180,8 +180,8 @@ FILE: objectInnerClass.kt
R|<local>/child|.<Unresolved name: baseFun>#()
R|<local>/child|.<Unresolved name: property>#
R|<local>/child|.<Unresolved name: foo>#()
R|<local>/child|.R|/anonymous.hoo|()
R|<local>/child|.R|/anonymous.voo|()
(this@R|/anonymous|, R|<local>/child|).R|/anonymous.hoo|()
(this@R|/anonymous|, R|<local>/child|).R|/anonymous.voo|()
}
}
@@ -451,7 +451,7 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
function: F,
resolutionMode: ResolutionMode,
): CompositeTransformResult<F> {
if (function is FirSimpleFunction) {
if (function is FirSimpleFunction && context.containerIfAny !is FirClass<*>) {
context.storeFunction(function)
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface T {
fun result(): String
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface T {
fun result(): String
}