diff options
author | Nadrieril | 2019-04-11 17:07:25 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-11 17:07:25 +0200 |
commit | 61b2ac7fb35c2a8aca703d5a5f9a9a8f28def977 (patch) | |
tree | 23f5931e3002c142ec4055f9001257f84ce7b3ec /dhall | |
parent | c42b3daead61f7ae59a2fb2d31be772eeb2205dc (diff) |
Be more civilized when typecheck case unimplemented
Diffstat (limited to '')
-rw-r--r-- | dhall/src/typecheck.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<S> { NoDependentLet(Normalized, Normalized), NoDependentTypes(Normalized, Normalized), MustCombineARecord(SubExpr<S, X>, SubExpr<S, X>), + Unimplemented, } /// A structured type error that includes context |