Skip to content

Commit

Permalink
feat(check): Avoid propagating errors on lift_io! misuse
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Nov 8, 2019
1 parent 752e2bc commit 3dbabe5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lift_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ impl Macro for LiftIo {
env.run(&mut symbols, &mut module);
let typ = module.env_type_of(&EmptyEnv::default());

match *typ {
Type::Record(_) => (),
_ => {
return Box::new(future::err(macros::Error::message(format!(
"The second argument to `lift_io!` must be a record. Found: `{}`",
typ
))))
}
}

let span = module.span;

let vm = env.vm;
Expand Down

0 comments on commit 3dbabe5

Please sign in to comment.