diff options
author | Nadrieril | 2020-12-07 19:02:07 +0000 |
---|---|---|
committer | Nadrieril | 2020-12-07 19:35:30 +0000 |
commit | 4473f3549f331c51a7df0e307d356a06c00d7288 (patch) | |
tree | ba36f2ecb834d861f606d2fef09038f0de5cdc91 /dhall/src/semantics/tck | |
parent | 7a392b07166c089979e69d4c8a68da3298964c28 (diff) |
Resolve imports and alternatives outside of the ast traversal
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/tck/typecheck.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dhall/src/semantics/tck/typecheck.rs b/dhall/src/semantics/tck/typecheck.rs index e14bcc6..23c2bd2 100644 --- a/dhall/src/semantics/tck/typecheck.rs +++ b/dhall/src/semantics/tck/typecheck.rs @@ -193,6 +193,14 @@ pub fn type_with<'cx, 'hir>( let typed = env.cx()[import].unwrap_result(); Tir::from_hir(hir, typed.ty.clone()) } + HirKind::ImportAlternative(alt, left, right) => { + let hir = if env.cx()[alt].unwrap_selected() { + left + } else { + right + }; + return type_with(env, hir, annot); + } HirKind::Expr(ExprKind::Var(_)) => { unreachable!("Hir should contain no unresolved variables") } |