summaryrefslogtreecommitdiff
path: root/dhall/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril2020-12-06 21:41:03 +0000
committerNadrieril2020-12-07 19:34:38 +0000
commit6287b7a7f9e421877ee13fefa586395fec844c99 (patch)
tree65129001dbd7e56561df656dc8eee8f441a05b25 /dhall/src/lib.rs
parent9991bd4891774c4dd598decae02ee860554d2ab7 (diff)
Thread cx through typecheck
Diffstat (limited to 'dhall/src/lib.rs')
-rw-r--r--dhall/src/lib.rs11
1 files changed, 8 insertions, 3 deletions
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<Resolved, Error> {
- resolve::resolve(self)
+ // TODO: thread cx
+ Ctxt::with_new(|cx| resolve::resolve(cx, self))
}
pub fn skip_resolve(self) -> Result<Resolved, Error> {
resolve::skip_resolve(self)
@@ -91,10 +92,14 @@ impl Parsed {
impl Resolved {
pub fn typecheck(&self) -> Result<Typed, TypeError> {
- 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<Typed, TypeError> {
- 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 {