Skip to content

Commit

Permalink
Test Trac #7856
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Peyton Jones committed Apr 29, 2013
1 parent aee9b17 commit 8139121
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/typecheck/should_fail/T7856.hs
@@ -0,0 +1,19 @@
module T7856 where

tmp :: String -> IO ()
tmp = sequence_ lst
where lst = [putStrLn "hi"]

-- sequence_ :: Monad m => [m a] -> m ()

{- m () ~ (->) String (IO ())
m a ~ IO ()
Depends which one gets treated first.
m := IO
is better than
m := (->) String
It's a bit random which is chosen.
I'll put it in regression suite so we see if it wobbles around.
-}
11 changes: 11 additions & 0 deletions tests/typecheck/should_fail/T7856.stderr
@@ -0,0 +1,11 @@

T7856.hs:4:7:
Couldn't match expected type ‛String -> IO ()’
with actual type ‛IO ()’
Possible cause: ‛sequence_’ is applied to too many arguments
In the expression: sequence_ lst
In an equation for ‛tmp’:
tmp
= sequence_ lst
where
lst = [putStrLn "hi"]
1 change: 1 addition & 0 deletions tests/typecheck/should_fail/all.T
Expand Up @@ -306,3 +306,4 @@ test('TcNullaryTCFail', when(compiler_lt('ghc', '7.7'), skip), compile_fail, [''
test('T7857', normal, compile_fail, [''])
test('T7778', normal, compile_fail, [''])
test('T7851', normal, compile_fail, [''])
test('T7856', normal, compile_fail, [''])

0 comments on commit 8139121

Please sign in to comment.