summaryrefslogtreecommitdiff
path: root/dhall/src/semantics
diff options
context:
space:
mode:
authorNadrieril2019-12-24 21:21:10 +0000
committerNadrieril2019-12-24 21:21:10 +0000
commit611d4ced3a5ffca8b9765971001995a216dbbb54 (patch)
tree52eacf3844e308cd9e2733a77de458f19135e85b /dhall/src/semantics
parentf67d30cf563b835c067107cf88769414f170416c (diff)
Ensure the output of type inference matches the spec variable names
Diffstat (limited to '')
-rw-r--r--dhall/src/semantics/phase/typecheck.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/dhall/src/semantics/phase/typecheck.rs b/dhall/src/semantics/phase/typecheck.rs
index 97502d4..e9836e8 100644
--- a/dhall/src/semantics/phase/typecheck.rs
+++ b/dhall/src/semantics/phase/typecheck.rs
@@ -288,7 +288,7 @@ fn type_of_builtin<E>(b: Builtin) -> Expr<E> {
optional
),
OptionalNone => make_type!(
- forall (a: Type) -> Optional a
+ forall (A: Type) -> Optional A
),
})
}
@@ -503,9 +503,9 @@ fn type_last_layer(
RetTypeOnly(
tck_pi_type(
ctx,
- "_".into(),
+ x.clone(),
t.clone(),
- r.under_binder(Label::from("_")),
+ r.under_binder(x),
)?
)
},
@@ -764,12 +764,12 @@ fn type_last_layer(
}
}
- match (inferred_type, type_annot) {
- (Some(ref t1), Some(t2)) => {
- if t1 != t2 {
+ match (inferred_type, type_annot.as_ref()) {
+ (Some(t1), Some(t2)) => {
+ if &t1 != t2 {
return mkerr(MergeAnnotMismatch);
}
- RetTypeOnly(t2.clone())
+ RetTypeOnly(t1)
}
(Some(t), None) => RetTypeOnly(t),
(None, Some(t)) => RetTypeOnly(t.clone()),