summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/tck/env.rs
diff options
context:
space:
mode:
authorNadrieril2020-02-09 21:58:28 +0000
committerNadrieril2020-02-09 21:58:28 +0000
commit21db63d3e614554f258526182c7ed89a2c244b65 (patch)
treeb222217123f53774e2c5c70160c3fc48e08045fc /dhall/src/semantics/tck/env.rs
parenta709c65eb28f1b6a666f15bfc2255da7bc7105ab (diff)
Take Hir for typecheck
Diffstat (limited to '')
-rw-r--r--dhall/src/semantics/tck/env.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/dhall/src/semantics/tck/env.rs b/dhall/src/semantics/tck/env.rs
index af955f4..3b02074 100644
--- a/dhall/src/semantics/tck/env.rs
+++ b/dhall/src/semantics/tck/env.rs
@@ -21,9 +21,9 @@ pub(crate) struct TyEnv {
}
impl VarEnv {
- // pub fn new() -> Self {
- // VarEnv { size: 0 }
- // }
+ pub fn new() -> Self {
+ VarEnv { size: 0 }
+ }
pub fn size(&self) -> usize {
self.size
}
@@ -116,9 +116,7 @@ impl TyEnv {
items: self.items.insert_value(e, ty),
}
}
- pub fn lookup(&self, var: &V) -> Option<(AlphaVar, Type)> {
- let var = self.names.unlabel_var(var)?;
- let ty = self.items.lookup_ty(&var);
- Some((var, ty))
+ pub fn lookup(&self, var: &AlphaVar) -> Type {
+ self.items.lookup_ty(&var)
}
}