Next: , Previous: , Up: Well-formedness – System   [Contents][Index]


11.12.7 Cannot bind wildcard to requires port

Since injected ports are always requires ports and a wildcard is used to bind such a port, the other side of a wildcard binding must be a provides port. In this example:

interface ihello
{
  in void hello ();
  behavior {on hello:{}}
}

component hello
{
  requires injected ihello r;
}

component logger
{
  requires ihello r;
}

component binding_wildcard_requires
{
  system
  {
    hello h;
    logger log;

    log.r <=> *;
  }
}

This results in the following error message:

binding-wildcard-requires.dzn:24:5: error: cannot bind wildcard to
    requires port `r'
binding-wildcard-requires.dzn:14:3: info: port `r' defined here