Ticket #4912 (closed bug: fixed)
No warnings for orphan instances declared via TypeSynonymInstances
Description
File Classes.hs:
module Classes where
data TheirData = TheirData
class Foo a where
foo :: a -> a
class Bar a where
bar :: a -> String
File Orphans.hs:
{-# LANGUAGE TypeSynonymInstances #-}
module Orphans where
import Classes
type OurData = TheirData
instance Foo TheirData where
foo = id
instance Bar OurData where
bar _ = "Ours"
Compile:
$ ghc --make -fforce-recomp -fwarn-orphans Orphans.hs [1 of 2] Compiling Classes ( Classes.hs, Classes.o ) [2 of 2] Compiling Orphans ( Orphans.hs, Orphans.o ) Orphans.hs:9:10: Warning: orphan instance: instance Foo TheirData
This is not my expected result. We should get orphan instance warnings for Bar OurData? as well, since OurData? is just a thinly-disguised version of TheirData?.
Change History
Note: See
TracTickets for help on using
tickets.
