From 6287b7a7f9e421877ee13fefa586395fec844c99 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 6 Dec 2020 21:41:03 +0000 Subject: Thread cx through typecheck --- dhall/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'dhall/src/lib.rs') diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index d079e92..661c33c 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -77,7 +77,8 @@ impl Parsed { } pub fn resolve(self) -> Result { - resolve::resolve(self) + // TODO: thread cx + Ctxt::with_new(|cx| resolve::resolve(cx, self)) } pub fn skip_resolve(self) -> Result { resolve::skip_resolve(self) @@ -91,10 +92,14 @@ impl Parsed { impl Resolved { pub fn typecheck(&self) -> Result { - Ok(Typed::from_tir(typecheck(&self.0)?)) + // TODO: thread cx + Ctxt::with_new(|cx| Ok(Typed::from_tir(typecheck(cx, &self.0)?))) } pub fn typecheck_with(self, ty: &Hir) -> Result { - Ok(Typed::from_tir(typecheck_with(&self.0, ty)?)) + // TODO: thread cx + Ctxt::with_new(|cx| { + Ok(Typed::from_tir(typecheck_with(cx, &self.0, ty)?)) + }) } /// Converts a value back to the corresponding AST expression. pub fn to_expr(&self) -> Expr { -- cgit v1.2.3