Skip to content

Commit

Permalink
fix error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Sep 24, 2024
1 parent e928a37 commit 86b0a2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion jit-compiler/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn generate_glue_code<T: FieldElement>(
let ty = analyzed.type_of_symbol(sym);
if ty != int_int_fun && ty.ty != Type::Col {
return Err(format!(
"Only (int -> int) functions and columns are supported, but requested {}",
"Only (int -> int) functions and columns are supported, but requested{}",
format_type_scheme_around_name(sym, &Some(ty)),
));
}
Expand Down
12 changes: 7 additions & 5 deletions jit-compiler/tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ fn identity_function() {

assert_eq!(f(10), 10);
}
#[test]
#[should_panic = "Only (int -> int) functions and columns are supported, but requested c: int -> bool"]
fn invalid_function() {
let _ = compile("let c: int -> bool = |i| true;", "c");
}

#[test]
fn sqrt() {
let f = compile(
Expand All @@ -41,3 +37,9 @@ fn sqrt() {
assert_eq!(f(99), 9);
assert_eq!(f(0), 0);
}

#[test]
#[should_panic = "Only (int -> int) functions and columns are supported, but requested c: int -> bool"]
fn invalid_function() {
let _ = compile("let c: int -> bool = |i| true;", "c");
}

0 comments on commit 86b0a2d

Please sign in to comment.