Commit 8e967dcb authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add test for too many/few args in higher order situation

parent 30724a09
......@@ -234,3 +234,4 @@ test('mc22', normal, compile_fail, [''])
test('mc23', normal, compile_fail, [''])
test('mc24', normal, compile_fail, [''])
test('mc25', normal, compile_fail, [''])
test('tcfail207', normal, compile_fail, [''])
module Foo where
f :: Int -> [Int] -> [Int]
-- Want an error message that says 'take' is applied to too many args
f x = take x []
g :: [Int]
-- Want an error message that says 'take' is applied to too few args
g = take 3
tcfail207.hs:5:7:
Couldn't match expected type `[Int] -> [Int]'
with actual type `[a0]'
In the return type of a call of `take'
Probable cause: `take' is applied to too many arguments
In the expression: take x []
In an equation for `f': f x = take x []
tcfail207.hs:9:5:
Couldn't match expected type `[Int]'
with actual type `[a0] -> [a0]'
In the return type of a call of `take'
Probable cause: `take' is applied to too few arguments
In the expression: take 3
In an equation for `g': g = take 3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment