Next: Action value discarded, Previous: Call in member variable initializer, Up: Well-formedness -- Valued Actions and Calls [Contents][Index]
call
used in a complex expressionA function call
is used in a complex expression.
enum result {OK, FAIL}; interface call_in_complex_expression { in result hello (); behavior { result f () { return result.OK; } result g (result r) { return r; } result r = result.OK; on hello: { bool b = f () != result.OK; // not allowed result r = g (f ()); // not allowed if (f () == g (result.OK)) // not allowed reply (result.OK); else if (f () != result.OK) reply (f ()); } } }
This results in the following error messages:
call-in-complex-expression.dzn:20:16: error: call used in a complex expression call-in-complex-expression.dzn:21:21: error: call used in a complex expression call-in-complex-expression.dzn:22:19: error: call used in a complex expression