Metalama icon indicating copy to clipboard operation
Metalama copied to clipboard

Invokers targeting event raise from event raise template

Open addabis opened this issue 4 months ago • 0 comments

A follow-up of #549. The current public API probably cannot express the difference between calling a handler received by Raise template Vs. invoking another event.

There are the following things the user can do:

  • Call the handler from the template using meta.Proceed. This preserves all parameters (and their order) received by the template.
  • Call the handler with different parameters. This would naturally require invoker-like syntax.
  • Call an invoker of the same event with specified options.

The last point poses a problem - it's easy to introduce an infinite cycle or to call the underlying event multiple times since the template represents "invocation of a single delegate".

Therefore, using invokers within this kind of template (or aux templates called) should be limited to Default invoker options. Otherwise, an error should be produced.

The current behavior ignores the order, and the invoker always targets the handler.

addabis avatar Sep 08 '25 07:09 addabis