From 696efe66336a268054c475fab9fe6505bdfc7b60 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 4 Aug 2019 13:00:56 +0200 Subject: Add some new tests and implement import alternatives --- dhall/src/error/mod.rs | 2 +- dhall/src/phase/resolve.rs | 4 ++-- dhall/src/phase/typecheck.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'dhall') diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs index aed6ccd..a0ee30a 100644 --- a/dhall/src/error/mod.rs +++ b/dhall/src/error/mod.rs @@ -86,7 +86,7 @@ pub(crate) enum TypeMessage { RecordTypeMergeRequiresRecordType(Type), RecordTypeMismatch(Type, Type, Type, Type), UnionTypeDuplicateField, - Unimplemented, + // Unimplemented, } impl TypeError { diff --git a/dhall/src/phase/resolve.rs b/dhall/src/phase/resolve.rs index f1329aa..0609694 100644 --- a/dhall/src/phase/resolve.rs +++ b/dhall/src/phase/resolve.rs @@ -86,7 +86,7 @@ fn do_resolve_expr( } } }; - let expr = expr.traverse_embed(resolve)?; + let expr = expr.traverse_resolve(resolve)?; Ok(Resolved(expr)) } @@ -100,7 +100,7 @@ pub fn skip_resolve_expr( let resolve = |import: &Import| -> Result { Err(ImportError::UnexpectedImport(import.clone())) }; - let expr = expr.traverse_embed(resolve)?; + let expr = expr.traverse_resolve(resolve)?; Ok(Resolved(expr)) } diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index 8551503..753d25e 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -823,7 +823,7 @@ fn type_last_layer( RightBiasedRecordMerge => unreachable!(), RecursiveRecordMerge => unreachable!(), RecursiveRecordTypeMerge => unreachable!(), - _ => return Err(mkerr(Unimplemented)), + ImportAlt => unreachable!("There should remain no import alternatives in a resolved expression"), })?; ensure_equal!( -- cgit v1.2.3