From 7644fe32e7dd926ef5d1db7d5eec20225f790144 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 26 Dec 2010 19:01:52 +0000 Subject: More sensible check for Fn type. git-svn-id: http://svn.drobilla.net/resp/resp@355 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/constrain.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/constrain.cpp') 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(); -- cgit v1.2.1