Skip to content
Playground(another site)

bynk.event.handler_param_type_mismatch

Error An on event(e: T) handler's declared parameter type does not match its from Events(E) header's event type.

An on event handler's first parameter is the event itself, so its type must be the one the from Events(E) header names. A subscription pattern is checked against that event, and the body reads e at that type. Make the parameter E, or change the header to the event you mean to handle. The optional second parameter is EventEnvelope; other mistakes there are bynk.event.bad_params.

Example

event Paid = { id: String }
event Refunded = { id: String }
service onPaid from Events(Paid) {
on event(e: Refunded) -> Effect[()] { … } // ✗ the header says `Paid`
on event(e: Paid) -> Effect[()] { … } // ✓
}

In the Book

See also

  • Every code in its category, Events, on the diagnostic index.
  • bynk explain bynk.event.handler_param_type_mismatch shows the same from the installed toolchain, without a network.