Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / typecheck / should_run / Defer01.hs
1 -- Test -fdefer-type-errors
2 -- Should compile and run
3
4 {-# LANGUAGE FlexibleContexts #-}
5 {-# LANGUAGE GADTs #-}
6 {-# OPTIONS_GHC -fdefer-type-errors #-}
7
8 module Main where
9
10 t5624 :: IO ()
11 t5624 = putStr "Hello World" >> putStr ','
12
13 a :: Int
14 a = 'p'
15
16 data B = B
17 b :: B -> Bool
18 b x = x == x
19
20 data C a where
21 C1 :: C Int
22 C2 :: Bool -> C Bool
23
24 c :: C Int -> Bool
25 c (C2 x) = True
26
27 d :: a -> a
28 d = 1
29
30 e = 'p'
31 f = e 'q'
32
33 h :: a -> (Char,Char)
34 h x = (x,'c')
35
36 data T a where
37 K :: a -> T a
38
39 i a = seq (not (K a)) ()
40
41 class MyClass a where myOp :: a -> String
42
43 j = myOp 23 -- Two errors, should not combine them
44
45 -- No longer reported as an error: #12466
46 k :: (Int ~ Bool) => Int -> Bool
47 k x = x
48
49 l :: IO ()
50 l = putChar >> putChar 'p'
51
52 main :: IO ()
53 main = print "No errors!"