diff options
-rw-r--r-- | src/constrain.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index 38d731a..45fead8 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -272,9 +272,7 @@ constrain_call(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) const AType* fnType = tenv.var(head); if (fnType->kind != AType::VAR) { - if (fnType->kind == AType::PRIM - || fnType->list_len() < 2 - || fnType->head()->str() != "Fn") + if (!is_form(fnType, "Fn")) throw Error(call->loc, (format("call to non-function `%1%'") % head->str()).str()); size_t numArgs = fnType->prot()->list_len(); |