[FIR] Pass proper containing classes from context to type resolution for local classes

This commit is contained in:
Dmitriy Novozhilov
2021-11-25 13:33:01 +03:00
committed by teamcityserver
parent 98934e15c0
commit 2b84e8e68f
10 changed files with 114 additions and 5 deletions
@@ -0,0 +1,35 @@
FILE: privateFromInAnonymousObject.kt
public final class Base : R|kotlin/Any| {
public constructor(): R|Base| {
super<R|kotlin/Any|>()
}
private final class Private : R|kotlin/Any| {
public constructor(): R|Base.Private| {
super<R|kotlin/Any|>()
}
}
public final fun test(): R|kotlin/Unit| {
object : R|kotlin/Any| {
private constructor(): R|<anonymous>| {
super<R|kotlin/Any|>()
}
public final val x: R|Base.Private| = R|/Base.Private.Private|()
public get(): R|Base.Private|
init {
lval y: R|Base.Private| = R|/Base.Private.Private|()
}
public final fun foo(): R|kotlin/Unit| {
lval z: R|Base.Private| = R|/Base.Private.Private|()
}
}
}
}
@@ -0,0 +1,20 @@
// FIR_IDENTICAL
// FIR_DUMP
class Base {
private class Private
fun test() {
object {
val x: Private = Private()
init {
val y: Private = Private()
}
fun foo() {
val z: Private = Private()
}
}
}
}
@@ -0,0 +1,16 @@
package
public final class Base {
public constructor Base()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final fun test(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
private final class Private {
public constructor Private()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}