interface SymbolOwner> { } interface Symbol> { } interface ReceiverValue { abstract val type: String abstract get } class ImplicitReceiverValue> : ReceiverValue { constructor(boundSymbol: S?, type: String) /* primary */ { super/*Any*/() /* () */ } val boundSymbol: S? field = boundSymbol get override val type: String field = type override get } abstract class ImplicitReceiverStack : Iterable> { constructor() /* primary */ { super/*Any*/() /* () */ } abstract operator fun get(name: String?): ImplicitReceiverValue<*>? } class PersistentImplicitReceiverStack : ImplicitReceiverStack, Iterable> { constructor(stack: List>) /* primary */ { super/*ImplicitReceiverStack*/() /* () */ } private val stack: List> field = stack private get override operator fun iterator(): Iterator> { return .().iterator() } override operator fun get(name: String?): ImplicitReceiverValue<*>? { return .().lastOrNull>() } } fun bar(s: String) { } fun foo(stack: PersistentImplicitReceiverStack) { stack.forEach>(action = local fun (it: ImplicitReceiverValue<*>) { it.() /*~> Unit */ bar(s = it.()) } ) } fun box(): String { val stack: PersistentImplicitReceiverStack = PersistentImplicitReceiverStack(stack = listOf>(elements = [ImplicitReceiverValue(boundSymbol = null, type = "O"), ImplicitReceiverValue(boundSymbol = null, type = "K")])) foo(stack = stack) return stack.first>().().plus(other = { // BLOCK val tmp0_safe_receiver: ImplicitReceiverValue<*>? = stack.get(name = null) when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null else -> tmp0_safe_receiver.() } }) }