silver icon indicating copy to clipboard operation
silver copied to clipboard

Allow custom error message for assertion failures via @msg annotation

Open marcoeilers opened this issue 1 year ago • 1 comments

For example,

method test0(x: Ref)
{
   @msg("Custom error message") assert x != null
}

leads to Silicon output

Silicon found 1 error in 2.83s:
  [0] Custom error message

Requested by @tdardinier.

marcoeilers avatar Oct 09 '24 17:10 marcoeilers

can this annotation be used in function preconditions too to override the error message if the precondition does not hold?

jcp19 avatar Aug 16 '25 10:08 jcp19