From 726c281cdd3824fcfdde34fe8d01f95416f7808c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 7 May 2019 16:01:24 +0200 Subject: Clean up some of the SubExpr type-changing methods --- dhall/src/phase/typecheck.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dhall/src/phase/typecheck.rs') diff --git a/dhall/src/phase/typecheck.rs b/dhall/src/phase/typecheck.rs index 3e6986f..32c1531 100644 --- a/dhall/src/phase/typecheck.rs +++ b/dhall/src/phase/typecheck.rs @@ -230,7 +230,7 @@ pub(crate) fn type_of_const(c: Const) -> Result { } } -fn type_of_builtin(b: Builtin) -> Expr { +fn type_of_builtin(b: Builtin) -> Expr { use dhall_syntax::Builtin::*; match b { Bool | Natural | Integer | Double | Text => dhall::expr!(Type), @@ -635,7 +635,7 @@ fn type_last_layer( } Const(c) => Ok(RetTyped(Typed::from_const(c))), Builtin(b) => { - Ok(RetType(mktype(ctx, rc(type_of_builtin(b)).note_absurd())?)) + Ok(RetType(mktype(ctx, rc(type_of_builtin(b)).absurd())?)) } BoolLit(_) => Ok(RetType(builtin_to_type(Bool)?)), NaturalLit(_) => Ok(RetType(builtin_to_type(Natural)?)), @@ -712,7 +712,7 @@ pub(crate) fn typecheck_with( ty: &Type, ) -> Result { let expr: SubExpr<_, _> = e.0; - let ty: SubExpr<_, _> = ty.to_expr().embed_absurd().note_absurd(); + let ty: SubExpr<_, _> = ty.to_expr().absurd(); type_of(expr.rewrap(ExprF::Annot(expr.clone(), ty))) } pub(crate) fn skip_typecheck(e: Resolved) -> Typed { -- cgit v1.2.3