From 61b2ac7fb35c2a8aca703d5a5f9a9a8f28def977 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 11 Apr 2019 17:07:25 +0200 Subject: Be more civilized when typecheck case unimplemented --- dhall/src/typecheck.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dhall') diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index cab734e..94a86e1 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -565,7 +565,7 @@ pub fn type_with( NaturalPlus => dhall::subexpr!(Natural), NaturalTimes => dhall::subexpr!(Natural), TextAppend => dhall::subexpr!(Text), - _ => panic!("Unimplemented typecheck case: {:?}", e), + _ => Err(mkerr(Unimplemented))?, }); ensure_equal!( @@ -583,7 +583,7 @@ pub fn type_with( Ok(RetType(t)) } Embed(p) => match p {}, - _ => panic!("Unimplemented typecheck case: {:?}", e), + _ => Err(mkerr(Unimplemented))?, }, }?; match ret { @@ -629,6 +629,7 @@ pub enum TypeMessage { NoDependentLet(Normalized, Normalized), NoDependentTypes(Normalized, Normalized), MustCombineARecord(SubExpr, SubExpr), + Unimplemented, } /// A structured type error that includes context -- cgit v1.2.3