summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T13873.hs
blob: 1736252e23b7aa7edd068c57ed6e5b3b51f66dfe (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
module T13873 where

data ST s = MkST

class M a where
  foo :: a -> Int

instance M (ST s) where
  foo x = 3

wimwam :: M a => Bool -> a -> Int
wimwam True  x = wimwam False x
wimwam False x = foo x

f :: ST s -> Int
f x = wimwam True x + 1

-- The question is: do we get an auto-generate
-- specialisation for
--    RULE forall s (d:M (ST s)). wimwam @(ST s) d
--                                  = $swimwam @s
--
-- The hand-written pragma would be:
--    SPECIALISE wimwam :: Bool -> ST s -> Int