[FIR] Correctly build scopes for resolve of different parts of constructors

#KT-40409 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-07-17 15:24:24 +03:00
parent 94ff457e43
commit 236dfe60f1
27 changed files with 287 additions and 124 deletions
@@ -0,0 +1,17 @@
// ISSUE #KT-40409
interface A {
var b: B
}
interface B
fun A.test_1() {
object : B by this.b {}
}
fun A.test_2() {
object : B by b {}
}
class D(val x: String, val y: String = this.<!UNRESOLVED_REFERENCE!>x<!>) {}
@@ -0,0 +1,45 @@
FILE: anonymousObjectByDelegate.kt
public abstract interface A : R|kotlin/Any| {
public abstract var b: R|B|
public get(): R|B|
public set(value: R|B|): R|kotlin/Unit|
}
public abstract interface B : R|kotlin/Any| {
}
public final fun R|A|.test_1(): R|kotlin/Unit| {
object : R|B| {
local final field <$$delegate_0>: R|B|
private[local] constructor(): R|<anonymous>| {
super<R|kotlin/Any|>()
this@R|/<anonymous>|.R|<local>/<$$delegate_0>| = this@R|/test_1|.R|/A.b|
}
}
}
public final fun R|A|.test_2(): R|kotlin/Unit| {
object : R|B| {
local final field <$$delegate_0>: R|B|
private[local] constructor(): R|<anonymous>| {
super<R|kotlin/Any|>()
this@R|/<anonymous>|.R|<local>/<$$delegate_0>| = this@R|/test_2|.R|/A.b|
}
}
}
public final class D : R|kotlin/Any| {
public constructor(x: R|kotlin/String|, y: R|kotlin/String| = this#.<Unresolved name: x>#): R|D| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/String| = R|<local>/x|
public get(): R|kotlin/String|
public final val y: R|kotlin/String| = R|<local>/y|
public get(): R|kotlin/String|
}