<< §4.4.(a) General case parameter mapping | ↑ Table of Contents ↑ | §4.4.(c) Mapping the result of a base method >> |
§4.4.(b) Restrictions for callin replace bindings
The right-hand side of a parameter mapping may either be
the simple name of a base method argument without further computation,
or an arbitrary expression not containing any base method argument.
Each base method argument must either appear as a simple name in exactly one parameter mapping
or not be mapped at all. In the latter case, the original argument is "tunneled" to
the base call, meaning, the callin method does not see the argument, but it is passed
to the base method as expected.
If the base method declares a result, then
- if the role method also declares a result,
result
must be mapped to itself:result -> result
- if the role method does not declare a result, an arbitrary expression may be mapped to result:
expression -> result
If in this situation no result mapping exists, the result of the base call is "tunneled" and passed to the original caller (see fragile callin binding (§4.3.(e)) above).
These rules ensure that these bindings are reversible for the sake of base calls (§4.3).
As stated above a fragile callin binding (§4.3.(e)) is not allowed with a callin method that definitely has no base call (§4.3.(b)). A callin replace binding is not fragile if it provides the base result using a result mapping.
A callin method bound with replace to a base method returning void must not declare a non-void result.
<< §4.4.(a) General case parameter mapping | ↑ Table of Contents ↑ | §4.4.(c) Mapping the result of a base method >> |