Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / deSugar / should_compile / T3263-2.hs
1 -- #3263. New kind of warning on monadic bindings that discard a monadic result
2
3 module T3263 where
4
5 import Control.Monad.Fix
6
7 -- No warning
8 t1 :: Monad m => m Int
9 t1 = do
10 return 10
11
12 -- No warning
13 t2 :: Monad m => m (m Int)
14 t2 = return (return 10)
15
16 -- No warning
17 t3 :: Monad m => m (m Int)
18 t3 = do
19 return 10
20 return (return 10)
21
22 -- Warning
23 t4 :: forall m. Monad m => m Int
24 t4 = do
25 return (return 10 :: m Int)
26 return 10
27
28 -- No warning
29 t5 :: forall m. Monad m => m Int
30 t5 = do
31 _ <- return (return 10 :: m Int)
32 return 10
33
34 -- Warning
35 t6 :: forall m. MonadFix m => m Int
36 t6 = mdo
37 return (return 10 :: m Int)
38 return 10