You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any reason why in the IR plugin, the body of the @ContextResolved functions that it creates consists of a call to arrow.inject.annotations.contextual(ev: T, f: T.() -> R) for each proof, nested in a lambda recursively, then finally a call to the original function? At least that's what I'm understanding from the code.
I've tried this out myself previously, and the IR backend seems to not really care as to what expression you place as a context receiver argument. In fact, arbitrary function calls work just fine
Is this some future-proofing measure or something that I'm not seeing? Because it seems to be extra code that will need to be maintained down-the-road.
Btw, there's one case in the compiler where a context receiver argument is not just simply a reference to a context in scope, and that is when an implicit receiver (which includes context receivers) has been smartcasted and hence needs a smart-cast expression wrapped around it, So I'm guessing that's why the compiler allows arbitrary expressions there.
The text was updated successfully, but these errors were encountered:
Is there any reason why in the IR plugin, the body of the @ContextResolved functions that it creates consists of a call to
arrow.inject.annotations.contextual(ev: T, f: T.() -> R)
for each proof, nested in a lambda recursively, then finally a call to the original function? At least that's what I'm understanding from the code.I've tried this out myself previously, and the IR backend seems to not really care as to what expression you place as a context receiver argument. In fact, arbitrary function calls work just fine
Is this some future-proofing measure or something that I'm not seeing? Because it seems to be extra code that will need to be maintained down-the-road.
Btw, there's one case in the compiler where a context receiver argument is not just simply a reference to a context in scope, and that is when an implicit receiver (which includes context receivers) has been smartcasted and hence needs a smart-cast expression wrapped around it, So I'm guessing that's why the compiler allows arbitrary expressions there.
The text was updated successfully, but these errors were encountered: