From 711ad900153aedb7b35896c0705c932972edded2 Mon Sep 17 00:00:00 2001 From: Basile Henry Date: Fri, 27 Nov 2020 23:08:14 +0100 Subject: If can return a type --- dhall/src/operations/typecheck.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dhall/src/operations') diff --git a/dhall/src/operations/typecheck.rs b/dhall/src/operations/typecheck.rs index 3016fea..bc0e864 100644 --- a/dhall/src/operations/typecheck.rs +++ b/dhall/src/operations/typecheck.rs @@ -350,8 +350,8 @@ pub fn typecheck_operation( if *x.ty().kind() != NirKind::from_builtin(Builtin::Bool) { return span_err("InvalidPredicate"); } - if y.ty().ty().as_const() != Some(Const::Type) { - return span_err("IfBranchMustBeTerm"); + if y.ty().ty().as_const().is_none() { + return span_err("IfBranchMustBeTermTypeOrKind"); } if y.ty() != z.ty() { return span_err("IfBranchMismatch"); -- cgit v1.2.3