Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type errors trigger panics instead of generating Errors #121

Open
paulcadman opened this issue Jul 19, 2023 · 0 comments
Open

Type errors trigger panics instead of generating Errors #121

paulcadman opened this issue Jul 19, 2023 · 0 comments

Comments

@paulcadman
Copy link
Collaborator

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:

vamp-ir/src/halo2/api.rs

Lines 202 to 207 in ed24c69

#[test]
#[ignore] // This test panics in type checking
fn test_compile_type_error() {
let config = Config { quiet: true };
assert!(compile("(1, 2) = 1;", &config).is_err());
}

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

unify_types(expr_var, &Type::Int, types, &mut None).unwrap();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant