From 00fa24b851ff6337cf4c5c63f82d95488180a413 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 8 Apr 2019 17:56:35 +0200 Subject: Limit public API Closes #53 --- dhall/src/typecheck.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'dhall/src/typecheck.rs') diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index ba32408..5230aab 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -11,7 +11,7 @@ use self::TypeMessage::*; impl Resolved { pub fn typecheck(self) -> Result> { - type_of_(self.0.clone()) + type_of(self.0.clone()) } /// Pretends this expression has been typechecked. Use with care. pub fn skip_typecheck(self) -> Typed { @@ -604,12 +604,7 @@ pub fn type_with( /// `typeOf` is the same as `type_with` with an empty context, meaning that the /// expression must be closed (i.e. no free variables), otherwise type-checking /// will fail. -pub fn type_of(e: SubExpr) -> Result, TypeError> { - let e = type_of_(e)?; - Ok(e.get_type_move().into_normalized()?.into_expr()) -} - -pub fn type_of_(e: SubExpr) -> Result> { +pub fn type_of(e: SubExpr) -> Result> { let ctx = Context::new(); let e = type_with(&ctx, e)?; // Ensure the inferred type isn't UNTYPE -- cgit v1.2.3