summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/tck
diff options
context:
space:
mode:
authorNadrieril2020-12-07 14:32:06 +0000
committerNadrieril2020-12-07 19:34:39 +0000
commitc1fe26d45c831eec015ad5c015236fce1928613a (patch)
treebdba83d6854005d4de29fc38427967989367da6f /dhall/src/semantics/tck
parent8c5b3ff15f2125e9d731fc199e194e1993c36b37 (diff)
Pass import results via the global context
Diffstat (limited to 'dhall/src/semantics/tck')
-rw-r--r--dhall/src/semantics/tck/typecheck.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/dhall/src/semantics/tck/typecheck.rs b/dhall/src/semantics/tck/typecheck.rs
index 8218368..f47563e 100644
--- a/dhall/src/semantics/tck/typecheck.rs
+++ b/dhall/src/semantics/tck/typecheck.rs
@@ -184,7 +184,10 @@ pub fn type_with<'cx, 'hir>(
) -> Result<Tir<'cx, 'hir>, TypeError> {
let tir = match hir.kind() {
HirKind::Var(var) => Tir::from_hir(hir, env.lookup(*var)),
- HirKind::Import(_, ty) => Tir::from_hir(hir, ty.clone()),
+ HirKind::Import(import) => {
+ let typed = env.cx()[import].unwrap_result();
+ Tir::from_hir(hir, typed.ty.clone())
+ }
HirKind::Expr(ExprKind::Var(_)) => {
unreachable!("Hir should contain no unresolved variables")
}