[FIR] Include anonymous objects in containingDeclarations in FirDeclarationsResolveTransformer.kt

K1 and K2 still differ because of KT-58203

#KT-63434
This commit is contained in:
Evgeniy.Zhelenskiy
2024-01-26 00:29:56 +01:00
committed by Space Team
parent eb23984182
commit 55adeba011
10 changed files with 129 additions and 23 deletions
@@ -0,0 +1,17 @@
// SKIP_TXT
// FIR_DUMP
abstract class InlineCompletionSessionManager {
protected class Proto {
class Some
}
}
fun checkCannotAccess() {
object : InlineCompletionSessionManager() {
fun chch() {
val b: Proto = Proto()
if (b is Proto.Some) return
}
}
}
@@ -0,0 +1,40 @@
FILE: kt63434.fir.kt
public abstract class InlineCompletionSessionManager : R|kotlin/Any| {
public constructor(): R|InlineCompletionSessionManager| {
super<R|kotlin/Any|>()
}
protected final class Proto : R|kotlin/Any| {
public constructor(): R|InlineCompletionSessionManager.Proto| {
super<R|kotlin/Any|>()
}
public final class Some : R|kotlin/Any| {
public constructor(): R|InlineCompletionSessionManager.Proto.Some| {
super<R|kotlin/Any|>()
}
}
}
}
public final fun checkCannotAccess(): R|kotlin/Unit| {
object : R|InlineCompletionSessionManager| {
private constructor(): R|<anonymous>| {
super<R|InlineCompletionSessionManager|>()
}
public final fun chch(): R|kotlin/Unit| {
lval b: R|InlineCompletionSessionManager.Proto| = R|/InlineCompletionSessionManager.Proto.Proto|()
when () {
(R|<local>/b| is R|InlineCompletionSessionManager.Proto.Some|) -> {
^chch Unit
}
}
}
}
}
@@ -0,0 +1,17 @@
// SKIP_TXT
// FIR_DUMP
abstract class InlineCompletionSessionManager {
protected class Proto {
class Some
}
}
fun checkCannotAccess() {
object : InlineCompletionSessionManager() {
fun chch() {
val b: Proto = Proto()
if (b is <!INCOMPATIBLE_TYPES!>Proto.Some<!>) return
}
}
}