FIR: make both ImplicitReceiverStack.get implementations consistent
This commit is contained in:
+8
-2
@@ -43,8 +43,14 @@ class PersistentImplicitReceiverStack private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override operator fun get(name: String?): ImplicitReceiverValue<*>? {
|
override operator fun get(name: String?): ImplicitReceiverValue<*>? {
|
||||||
if (name == null) return stack.lastOrNull()
|
if (name == null) {
|
||||||
return indexesPerLabel[Name.identifier(name)].lastOrNull()?.let { stack[it] }
|
return stack.lastOrNull {
|
||||||
|
it !is ImplicitDispatchReceiverValue || !it.inDelegated
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return indexesPerLabel[Name.identifier(name)].lastOrNull()?.let { stack[it] }?.takeIf {
|
||||||
|
it !is ImplicitDispatchReceiverValue || !it.inDelegated
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun lastDispatchReceiver(): ImplicitDispatchReceiverValue? {
|
override fun lastDispatchReceiver(): ImplicitDispatchReceiverValue? {
|
||||||
|
|||||||
Reference in New Issue
Block a user