Scope of event binding unclear
When using event specifications, the event can be bound to a field via as
:
wait @my_event as myev if myev.speed >= 50kph
What can be safely assumed is that the scope of the binding extends into the if
clause, and the syntax actually currently only allows an as
binding when there is an if
clause.
However one would/could assume that the binding should extend further in the case of e.g. use in a on
directive:
on @my_event as myev:
call my_method(myev.speed)
If this is not intended we should clearly point out the restricted scope, and then the syntax/grammar matches this; if however this kind of usage was intended to be allowed, then this needs further description in the standard, and the grammar needs adjustment.