summaryrefslogtreecommitdiff
path: root/dhall/src/operations
diff options
context:
space:
mode:
authorBasile Henry2020-11-27 23:08:14 +0100
committerBasile Henry2020-11-27 23:08:50 +0100
commit711ad900153aedb7b35896c0705c932972edded2 (patch)
treef0ec889d5028b8d2e95ebf1e183da4271d243f36 /dhall/src/operations
parent8be3891b1e30f61b1f38b96e1ed200f367066032 (diff)
If can return a type
Diffstat (limited to 'dhall/src/operations')
-rw-r--r--dhall/src/operations/typecheck.rs4
1 files changed, 2 insertions, 2 deletions
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");