summaryrefslogtreecommitdiff
path: root/testsuite/tests/quantified-constraints/T17267c.hs
blob: caa93e8234172affbbe91f771a6d77b9bdcd08f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}

module T17267c where

-- Now rejected
class C a b where
  op :: a -> b

class C a b => Thing a b
instance C a b => Thing a b

unsafeCoerce :: forall a b. a -> b
unsafeCoerce a = oops (op a :: Thing a b => b)
  where
    oops :: (C a b => Thing a b) => (Thing a b => x) -> x
    oops r = r