Skip to content

Associated types at wrong type in instance

Consider

class C x where
  type T x

instance C (Either a b) where
  type T (Either b a) = b -> a

This is bogus, because the equation for T has the parameters to Either reversed. But GHC 8.0 RC1 (and master) allow it.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information