diff options
author | Nadrieril | 2019-05-09 16:56:17 +0200 |
---|---|---|
committer | Nadrieril | 2019-05-09 16:56:17 +0200 |
commit | bf74436781a1304a937fb31a50c5495223468087 (patch) | |
tree | 06df62ab914c39e3572e9729c9b1088eec549741 /dhall/src/phase | |
parent | 32051979778436ea02cb406551f126fe22ea1636 (diff) |
Small utility SubExpr::from_builtin
Diffstat (limited to '')
-rw-r--r-- | dhall/src/phase/typecheck.rs | 12 |
1 files changed, 3 insertions, 9 deletions
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<Type, TypeError> { - 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)); |