Open mtzguido opened 3 months ago
Another bad error message issue that I ran into is with partially applied functions with "preconditions", the error doesn't point to the actual use which violates the precondition. For example:
open Pulse.Lib.Pervasives
let divide (a: erased int) (b: erased int { reveal b <> 0 }) : GTot (erased int) = a / b
```pulse
fn test()
requires emp
ensures emp
{
let hundred = divide 100;
let unknown = hundred 0;
()
}
\```
results in an error pointing to divide
in let hundred = divide 100;
with a secondary span pointing to the b
argument of divide
. This makes the error very difficult to debug if I used hundred
in multiple places in the fn and I'm not sure which one may have been called with 0
First:
Highlights the whole body and says:
Very puzzling since we expect to see that we failed to prove the refinement, and on top of that
squash
is actually non-informative?Second:
Highlights the whole definition (from backticks to backticks) and says: