[FIR] Extend callableNames known for JvmMappedScope
This commit is contained in:
committed by
TeamCityServer
parent
94014ba3eb
commit
d6e144c80e
@@ -0,0 +1,85 @@
|
||||
interface SymbolOwner<E : SymbolOwner<E>> {
|
||||
|
||||
}
|
||||
|
||||
interface Symbol<E : SymbolOwner<E>> {
|
||||
|
||||
}
|
||||
|
||||
interface ReceiverValue {
|
||||
abstract val type: String
|
||||
abstract get
|
||||
|
||||
}
|
||||
|
||||
class ImplicitReceiverValue<S : Symbol<*>> : ReceiverValue {
|
||||
constructor(boundSymbol: S?, type: String) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val boundSymbol: S?
|
||||
field = boundSymbol
|
||||
get
|
||||
|
||||
override val type: String
|
||||
field = type
|
||||
override get
|
||||
|
||||
}
|
||||
|
||||
abstract class ImplicitReceiverStack : Iterable<ImplicitReceiverValue<*>> {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
abstract operator fun get(name: String?): ImplicitReceiverValue<*>?
|
||||
|
||||
}
|
||||
|
||||
class PersistentImplicitReceiverStack : ImplicitReceiverStack, Iterable<ImplicitReceiverValue<*>> {
|
||||
constructor(stack: List<ImplicitReceiverValue<*>>) /* primary */ {
|
||||
super/*ImplicitReceiverStack*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
private val stack: List<ImplicitReceiverValue<*>>
|
||||
field = stack
|
||||
private get
|
||||
|
||||
override operator fun iterator(): Iterator<ImplicitReceiverValue<*>> {
|
||||
return <this>.<get-stack>().iterator()
|
||||
}
|
||||
|
||||
override operator fun get(name: String?): ImplicitReceiverValue<*>? {
|
||||
return <this>.<get-stack>().lastOrNull<ImplicitReceiverValue<*>>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun bar(s: String) {
|
||||
}
|
||||
|
||||
fun foo(stack: PersistentImplicitReceiverStack) {
|
||||
stack.forEach<ImplicitReceiverValue<*>>(action = local fun <anonymous>(it: ImplicitReceiverValue<*>) {
|
||||
it.<get-boundSymbol>() /*~> Unit */
|
||||
bar(s = it.<get-type>())
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val stack: PersistentImplicitReceiverStack = PersistentImplicitReceiverStack(stack = listOf<ImplicitReceiverValue<Nothing>>(elements = [ImplicitReceiverValue<Nothing>(boundSymbol = null, type = "O"), ImplicitReceiverValue<Nothing>(boundSymbol = null, type = "K")]))
|
||||
foo(stack = stack)
|
||||
return stack.first<ImplicitReceiverValue<*>>().<get-type>().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.<get-type>()
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user