Commit 7c837ea5 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test for Trac #2111

parent a8ccf509
{-# OPTIONS_GHC -XArrows -XRecursiveDo #-}
-- Test Trac #2111
module Foo where
foo = do { rec { x <- undefined -< x }; undefined -< x }
bar1 = do { rec { x <- return ('a':x); }; putStrLn (take 20 x) }
bar2 = mdo { rec { x <- return ('a':x); }; putStrLn (take 20 x) }
T2111.hs:6:11:
Illegal 'rec' stmt in a 'do' expression
In a stmt of a 'do' expression: rec {x <- undefined -< x}
In the expression:
do rec {x <- undefined -< x}
undefined -< x
In the definition of `foo':
foo = do rec {x <- undefined -< x}
undefined -< x
T2111.hs:8:12:
Illegal 'rec' stmt in a 'do' expression
In a stmt of a 'do' expression: rec {x <- return ('a' : x)}
In the expression:
do rec {x <- return ('a' : x)}
putStrLn (take 20 x)
In the definition of `bar1':
bar1 = do rec {x <- return ('a' : x)}
putStrLn (take 20 x)
......@@ -4,3 +4,4 @@ test('arrowfail001', normal, compile_fail, [''])
test('arrowfail002', normal, compile_fail, [''])
test('arrowfail003', normal, compile_fail, [''])
test('arrowfail004', normal, compile_fail, [''])
test('T2111', normal, compile_fail, [''])
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