Remove knot-tying bug in TcHsSyn.zonkTyVarOcc
[ghc.git] / testsuite / tests / ado / T13875.hs
1 {-# LANGUAGE ApplicativeDo #-}
2 module Main where
3
4 import Control.Exception
5 import Control.Monad
6 import Data.Maybe
7 import System.Exit
8
9 test0 :: Maybe ()
10 test0 = do
11 () <- Just undefined
12 () <- Just undefined
13 return ()
14
15 test1 :: Maybe ()
16 test1 = do
17 (_,_) <- Just undefined
18 return ()
19
20 test2 :: Maybe (Int,Int)
21 test2 = do
22 x <- return 1
23 () <- Just undefined
24 y <- return 2
25 return (x,y)
26
27 main = do
28 b <- (print (isJust test0) >> return True)
29 `catch` \ErrorCall{} -> return False
30 when b $ die "failed0"
31 b <- (print (isJust test1) >> return True)
32 `catch` \ErrorCall{} -> return False
33 when b $ die "failed1"
34 b <- (print (isJust test2) >> return True)
35 `catch` \ErrorCall{} -> return False
36 when b $ die "failed2"