Child pages
  • Behavior

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Concept instance methods can be implemented both in concept declarations and in concept interfaces. This may lead to some method resolution issues. When MPS needs to decide, which virtual method to invoke in the inheritance hierarchy, the following algorithm method resolution order (MRO) algorithm is applied:

  • If the current concept implements a matching method, invoke it. Return the computed value.
  • Invoke the algorithm recursively for an extended concept, if there is one. In case of success return the computed value.
  • Invoke the algorithm recursively for all implemented concept interfaces in the order of their definition in the implements section. The first found interface implementing the method is used. In case of success return the computed value.
  • Invoke the algorithm recursively for an extended concept, if there is one. In case of success return the computed value.
  • Return failure.

Overriding behavior methods

...