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);
@Test public void TypeClassBug1() { test(); }
@Test(timeout=1000L) public void TypeInferenceBug2() { test(); }
@Test public void TypeInferenceBug3() { test(); }
+ @Test(timeout=100L) public void TypeInferenceBug4() { test(); }
@Test public void TypeOf1() { test(); }
@Test public void TypingBug1() { test(); }
@Test public void TypingError1() { test(); }
--- /dev/null
+import "Prelude"
+
+// See gitlab #303
+
+test :: () -> Integer
+test _ = let
+ f = id :: Integer -> Integer
+ in min f 1 f 2
+
+main = test ()
+--
+8:8-8:11: Constraint <Ord (Integer -> Integer)> is not given and cannot be derived.
+8:8-8:19: Application of non-function
+8:16-8:17: Expected <Integer> got <Integer -> Integer>.