Event handler signature mismatch (EventHandlerInvalidSignature)¶
| Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
|---|---|---|---|---|---|
Error |
BSLOS |
Major |
Yes |
5 |
suspiciousstandard |
Description¶
The signature of a platform-event handler method does not match the event contract: parameter count diverges. If the platform invokes the handler with N parameters but fewer are declared, the runtime either errors out or silently drops the parameter.
The contract is taken from the platform syntax helper (via bsl-context). All overloads of the event signature are considered; the diagnostic fires only if none of them fits.
Examples¶
// Fires: OnWrite requires Cancel parameter at least; empty signature does not fit.
Procedure OnWrite()
// ...
EndProcedure
// Does not fire:
Procedure OnWrite(Cancel)
// ...
EndProcedure
Sources¶
Snippets¶
Diagnostic ignorance in code¶
// BSLLS:EventHandlerInvalidSignature-off
// BSLLS:EventHandlerInvalidSignature-on
Parameter for config¶
"EventHandlerInvalidSignature": false