Previous: Cannot use inout
-parameter on out
-event, Up: Well-formedness – Data Parameters [Contents][Index]
Formal binding, which is the binding of a data member variable
data
to an event parameter p
using the p <- data
construct, is only allowed in a component, in an on
context.
Using <-
in any other context is reported as a parse error.
extern int $int$; interface ihello { in void hello (int i); in void cruel (int i); behavior { on hello:; on cruel:; } } component parse_out_binding { provides blocking ihello p; behavior { bool b = false; int data; blocking on p.hello (i <- data): {} blocking on p.cruel (b <- data): {} blocking on p.cruel (data <- i): {} blocking on p.cruel (k <- b): {} } }
This results in the following error messages:
out-binding-reversed.dzn:22:26: error: formal binding `i' is not a data member variable out-binding-reversed.dzn:23:26: error: formal binding `b' is not a data member variable