ghc-7 assumes incoherent instances without requiring language `IncoherentInstances`
|Reported by:||maeder||Owned by:||simonpj|
|Component:||Compiler (Type checker)||Version:||7.6.1|
|Type of failure:||GHC accepts invalid program||Difficulty:||Unknown|
|Test Case:||Blocked By:|
the attached examples works with ghc-7 and returns
*Main> a [Spec1 Spec2] *Main> b 
(One may wish that b also returned [Spec1 Spec2])
ghc-6 complains with
Splittable.hs:16:36: Overlapping instances for Test a Spec2 arising from a use of `test' at Splittable.hs:16:36-43 Matching instances: instance [overlap ok] Test a Spec2 -- Defined at Splittable.hs:20:13-24 instance [overlap ok] Test Bool Spec2 -- Defined at Splittable.hs:25:13-27 (The choice depends on the instantiation of `a' To pick the first instance above, use -XIncoherentInstances when compiling the other instance declarations) In the second argument of `($)', namely `test a b' In the expression: map Spec1 $ test a b In the definition of `test': test a (Spec1 b) = map Spec1 $ test a b Failed, modules loaded: none.
After adding IncoherentInstances the file also goes through ghc-6 with the same results.