Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / typecheck / should_fail / T12709.hs
1 {-# Language PolyKinds, ViewPatterns, RebindableSyntax,
2 MagicHash, NoImplicitPrelude #-}
3
4 module T12709 where
5
6 import GHC.Types
7 import Prelude hiding (Num (..))
8 import qualified Prelude as P
9 import GHC.Prim
10
11 data BoxUnbox = BUB Int Int#
12
13 class Num (a :: TYPE rep) where
14 (+) :: a -> a -> a
15
16 fromInteger :: Integer -> a
17
18 instance Num Int where
19 (+) = (P.+)
20 fromInteger = P.fromInteger
21
22 instance Num Int# where
23 (+) = (+#)
24 fromInteger (fromInteger -> I# n) = n
25
26 a :: BoxUnbox
27 a = let u :: Num (a :: TYPE rep) => a
28 u = 1 + 2 + 3 + 4
29 in
30 BUB u u