From b1906923a59e9313c4c9e32f37e4c86f2040cc1f Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 7 Apr 2019 12:04:53 +0200 Subject: More typecheck --- dhall/src/typecheck.rs | 155 ++++++++++++++++++++++++++++--------------------- 1 file changed, 89 insertions(+), 66 deletions(-) (limited to 'dhall/src') diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index 5be43cf..f380448 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -47,6 +47,16 @@ impl Normalized { fn into_type(self) -> Type<'static> { crate::expr::Type(Cow::Owned(TypeInternal::Expr(Box::new(self)))) } + // Expose the outermost constructor + #[inline(always)] + fn unroll_ref(&self) -> &Expr { + self.as_expr().as_ref() + } + #[inline(always)] + fn shift(&self, delta: isize, var: &V