summaryrefslogtreecommitdiff
path: root/testsuite/tests/mdo/should_compile/mdo006.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/mdo/should_compile/mdo006.hs')
-rw-r--r--testsuite/tests/mdo/should_compile/mdo006.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/mdo/should_compile/mdo006.hs b/testsuite/tests/mdo/should_compile/mdo006.hs
new file mode 100644
index 0000000000..6ccfb94041
--- /dev/null
+++ b/testsuite/tests/mdo/should_compile/mdo006.hs
@@ -0,0 +1,17 @@
+{-# OPTIONS -XRecursiveDo #-}
+
+-- This test, from Iavor Diatchki, made GHC 6.2 loop (testLoop)
+-- or panic (testPanic); there was a Lint error.
+-- The reason was a missing bindInstsOfLocalFuns in tcStmtAndThen
+
+module ShouldCompile where
+
+import Control.Monad.Fix
+
+testLoop _ = mdo x <- mapM undefined (f x)
+ let f _ = []
+ return (f x)
+
+testPanic _ = mdo x <- f x
+ let f _ = return ()
+ f x