current.setType(mfun.returnType);
if(marity < current.parameters.length) {
+ if (marity == 0) {
+ // Cannot eat away any more parameters
+ context.getErrorLog().log(location, "Application of non-function");
+ return current;
+ }
+
Expression[] missingParameters = Arrays.copyOfRange(current.parameters, marity, current.parameters.length);
functionType = mfun.returnType;
current.parameters = Arrays.copyOf(current.parameters, marity);