Child pages
  • Using_typesystem

Versions Compared


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


A result of a coerce expression is a boolean value, which says whether a certain type may be coerced to a given form, i.e. whether this type has a supertype, which has a given form (satisfies a certain condition). A condition could be written either as a reference to a concept declaration, which means that a sought-for supertype should be an instance of this concept; or as a pattern, which a sought-for supertype must matchematch.
A coerce expression is written coerce( type :< condition ) or coerceStrong( type :<< condition ), where condition is what has just been discussed above.