summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T17966.hs
blob: ca7803ea0b2431a49138a3b65b99287f15f15ae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}

-- The issue here is whether $cm gets a specialiation
-- See #17966

module T17966 where

class C a b where
  m :: Show c => a -> b -> c -> String

instance Show b => C Bool b where
  m a b c = show a ++ show b ++ show c
  {-# INLINABLE [0] m #-}

f :: (C a b, Show c) => a -> b -> c -> String
f a b c = m a b c ++ "!"
{-# INLINABLE [0] f #-}

x :: String
x = f True () (Just 42)