Simon Peyton Jones pushed to branch wip/T26255 at Glasgow Haskell Compiler / GHC
Commits:
-
fa3dd3c6
by Simon Peyton Jones at 2025-08-23T17:57:08+01:00
1 changed file:
Changes:
... | ... | @@ -854,7 +854,16 @@ Currently, the constraints to ignore are: |
854 | 854 | |
855 | 855 | (CIG2) Superclasses of Wanteds. These are generated on in case they trigger functional
|
856 | 856 | dependencies. If such a constraint is unsolved, then its "parent" constraint must
|
857 | - also be unsolved, and is much more informative to the user (#26255).
|
|
857 | + also be unsolved, and is much more informative to the user. Example (#26255):
|
|
858 | + class (MinVersion <= F era) => Era era where { ... }
|
|
859 | + f :: forall era. EraFamily era -> IO ()
|
|
860 | + f = ..blah... -- [W] Era era
|
|
861 | + Here we have simply omitted "Era era =>" from f's type. But we'll end up with
|
|
862 | + /two/ Wanted constraints:
|
|
863 | + [W] d1 : Era era
|
|
864 | + [W] d2 : MinVersion <= F era -- Superclass of d1
|
|
865 | + We definitely want to report d1 and not d2! Happily it's easy to filter out those
|
|
866 | + superclass-Wanteds, becuase their Origin betrays them.
|
|
858 | 867 | |
859 | 868 | Note [Implementation of Unsatisfiable constraints]
|
860 | 869 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|