From 611d4ced3a5ffca8b9765971001995a216dbbb54 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 24 Dec 2019 21:21:10 +0000 Subject: Ensure the output of type inference matches the spec variable names --- dhall/src/semantics/phase/typecheck.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'dhall/src/semantics/phase') 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(b: Builtin) -> Expr { 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()), -- cgit v1.2.3