Introduce GHC.TypeNats module, change KnownNat evidence to be Natural
[ghc.git] / testsuite / tests / typecheck / should_fail / tcfail203.hs
1 -- trac #2806
2
3 {-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
4 {-# OPTIONS_GHC -Wunbanged-strict-patterns #-}
5
6 module Foo where
7
8 import GHC.Base
9
10 pass1 = 'a'
11 where !x = 5#
12
13 pass2 = 'a'
14 where !(I# x) = 5
15
16 pass3 = 'a'
17 where !(b, I# x) = (True, 5)
18
19 pass4 = 'a'
20 where !(# b, I# x #) = (# True, 5 #)
21
22 pass5 = 'a'
23 where !(# b, x #) = (# True, 5# #)
24
25 fail1 = 'a'
26 where x = 5#
27
28 fail2 = 'a'
29 where (I# x) = 5
30
31 fail3 = 'a'
32 where (b, I# x) = (True, 5)
33
34 fail4 = 'a'
35 where (# b, I# x #) = (# True, 5 #)
36
37 fail5 = 'a'
38 where (# b, x #) = (# True, 5# #)
39
40 fail6 = 'a'
41 where (I# !x) = 5
42
43 fail7 = 'a'
44 where (b, !(I# x)) = (True, 5)
45
46 fail8 = 'a'
47 where (# b, !(I# x) #) = (# True, 5 #)
48
49 fail9 = 'a'
50 where (# b, !x #) = (# True, 5# #)
51 {-
52 -- Now in tcfail203a.hs, because it's an error
53 fail10 = 'a'
54 where !(b, ~(c, (I# x))) = (True, (False, 5))
55 -}