No warnings for orphan instances declared via TypeSynonymInstances
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |