{-# LANGUAGE TypeFamilies #-} import Data.Void class C a b where x :: a -> b instance {-# OVERLAPPING #-} C Void b where x = absurd instance {-# OVERLAPPABLE #-} C a a where x = id main :: IO () main = print (x (undefined :: Void) :: Void)