From 3dbabe5355aeb6b4f61dfa8bdae95b6593f5575c Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Sat, 9 Nov 2019 00:21:54 +0100 Subject: [PATCH] feat(check): Avoid propagating errors on lift_io! misuse --- src/lift_io.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lift_io.rs b/src/lift_io.rs index 17d0171d42..c601b7ac84 100644 --- a/src/lift_io.rs +++ b/src/lift_io.rs @@ -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;