From bf74436781a1304a937fb31a50c5495223468087 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 9 May 2019 16:56:17 +0200 Subject: Small utility SubExpr::from_builtin --- dhall/src/phase/typecheck.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'dhall') diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index 2dc97bb..66f5b5b 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -328,10 +328,7 @@ pub(crate) fn mktype( } pub(crate) fn builtin_to_type(b: Builtin) -> Result { - mktype( - &TypecheckContext::new(), - SubExpr::from_expr_no_note(ExprF::Builtin(b)), - ) + mktype(&TypecheckContext::new(), SubExpr::from_builtin(b)) } /// Intermediary return type @@ -390,15 +387,12 @@ fn type_with( return type_with(&ctx.insert_value(x, v.clone())?, e.clone()); } OldOptionalLit(None, t) => { - let none = SubExpr::from_expr_no_note(ExprF::Builtin( - Builtin::OptionalNone, - )); + let none = SubExpr::from_builtin(Builtin::OptionalNone); let e = e.rewrap(App(none, t.clone())); return type_with(ctx, e); } OldOptionalLit(Some(x), t) => { - let optional = - SubExpr::from_expr_no_note(ExprF::Builtin(Builtin::Optional)); + let optional = SubExpr::from_builtin(Builtin::Optional); let x = x.rewrap(SomeLit(x.clone())); let t = t.rewrap(App(optional, t.clone())); let e = e.rewrap(Annot(x, t)); -- cgit v1.2.3