summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T15431.hs
blob: 21fa4c4e38f0812948bbcc63abd283e0400ca5f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE GADTs, FlexibleContexts #-}

module T15431 where

import Data.Coerce

data T t where
  A :: Show (t a) => t a -> T t
  B :: Coercible Int (t a) => t a -> T t

f :: T t -> String
f (A t) = show t

g :: T t -> Int
g (B t) = coerce t