summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail203.hs
blob: 096cf5796bbbe8d2c67e87263c17152ffcf22861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- trac #2806

{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
{-# OPTIONS_GHC -Wunbanged-strict-patterns #-}

module Foo where

import GHC.Base

pass1 = 'a'
    where !x = 5#

pass2 = 'a'
    where !(I# x) = 5

pass3 = 'a'
    where !(b, I# x) = (True, 5)

pass4 = 'a'
    where !(# b, I# x #) = (# True, 5 #)

pass5 = 'a'
    where !(# b, x #) = (# True, 5# #)

fail1 = 'a'
    where x = 5#

fail2 = 'a'
    where (I# x) = 5

fail3 = 'a'
    where (b, I# x) = (True, 5)

fail4 = 'a'
    where (# b, I# x #) = (# True, 5 #)

fail5 = 'a'
    where (# b, x #) = (# True, 5# #)

fail6 = 'a'
    where (I# !x) = 5

fail7 = 'a'
    where (b, !(I# x)) = (True, 5)

fail8 = 'a'
    where (# b, !(I# x) #) = (# True, 5 #)

fail9 = 'a'
    where (# b, !x #) = (# True, 5# #)
{-
-- Now in tcfail203a.hs, because it's an error
fail10 = 'a'
    where !(b, ~(c, (I# x))) = (True, (False, 5))
-}