summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T14333.hs
blob: f4cd3bdf2b8899479e95ab3ea08e3fbdf75bff49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module T14333 where

import Data.Coerce

bad :: Coercible (a b) (c d) => c d -> a b
bad = coerce

bad2 :: Coercible (c d) (a b) => c d -> a b
bad2 = coerce

bad3 :: Coercible (a b) b => b -> a b
bad3 = coerce

bad4 :: Coercible b (a b) => b -> a b
bad4 = coerce

newtype Id a = MkId a

foo :: Id Int
foo = bad3 (3 :: Int)