Skip to content
Snippets Groups Projects
Commit 0ac2073a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Make simplifyInfer generalise only over simple class constraints

So we never infer
   f :: Eq (Tree a) => blah
when there isn't an instance for Eq (Tree a).

This fixes Trac #6022.

It does represent a change in behaviour: certain (bizarre) programs
will be rejected that were previously accepted. Specifically, if you
have

   module A where
   f x = ...somethign needing (C T)...

   moudule B where
   import A
   instance C T
   test = f True

Here the (C T) instance is provided "later".  But this is wierd; it
would be better to give a type signature for f
   f :: C T => Bool -> Bool
and then you'd be fine.
parent 05debbb4
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment