anoma / vamp-ir

Vamp-IR is a proof-system-agnostic language for writing arithmetic circuits
https://anoma.github.io/VampIR-Book/
Apache License 2.0
156 stars 44 forks source link

Type errors trigger panics instead of generating Errors #121

Open paulcadman opened 1 year ago

paulcadman commented 1 year ago

Type errors in vamp-ir files cause panics instead of returning an Error to the caller. This is relevant when vamp-ir is being used as a library, for example by Taiga.

See the (currently ignored) test for an example:

https://github.com/anoma/vamp-ir/blob/ed24c6981a8124a1628ef716d73063f2d87db56d/src/halo2/api.rs#L202-L207

To fix this issue we need to remove the .unwrap() calls in typecheck.rs, for example:

https://github.com/anoma/vamp-ir/blob/bac57310b28df49d8f34999adce12d3af29e332e/src/typecheck.rs#L515