Skip to main content

Assertions and Refinement

Assertions

Assertions are used to describe refinements on data and to specify properties that must hold true for functions and transforms. This feature is used to generate runtime checks after transpilation and used to specify properties to be verified at typechecking time using refinement type checking.

  • The assert statement causes the surrounding block expression to fail if a condition is not satisfied.
  • The assert statement causes the construction of a struct to fail if the condition mentioned in its definition is not satisfied.