diff --git a/tests/typecheck/should_fail/T7851.hs b/tests/typecheck/should_fail/T7851.hs new file mode 100644 index 000000000..686233c5b --- /dev/null +++ b/tests/typecheck/should_fail/T7851.hs @@ -0,0 +1,6 @@ +module T7851 where + +import Control.Monad.Trans.State + +bar = do print + print "Hello" diff --git a/tests/typecheck/should_fail/T7851.stderr b/tests/typecheck/should_fail/T7851.stderr new file mode 100644 index 000000000..ba5fc7ce4 --- /dev/null +++ b/tests/typecheck/should_fail/T7851.stderr @@ -0,0 +1,8 @@ + +T7851.hs:5:10: + Couldn't match expected type ‛IO a0’ with actual type ‛a1 -> IO ()’ + Probable cause: ‛print’ is applied to too few arguments + In a stmt of a 'do' block: print + In the expression: + do { print; + print "Hello" } diff --git a/tests/typecheck/should_fail/all.T b/tests/typecheck/should_fail/all.T index 8acc5820e..768b6ede9 100644 --- a/tests/typecheck/should_fail/all.T +++ b/tests/typecheck/should_fail/all.T @@ -305,3 +305,4 @@ test('TcNoNullaryTC', when(compiler_lt('ghc', '7.7'), skip), compile_fail, ['']) 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, [''])