diff options
author | Richard Eisenberg <rae@richarde.dev> | 2021-11-03 18:26:12 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-12 21:21:27 -0500 |
commit | 265ead8a7401e20d75ed4e476805508ea695f37f (patch) | |
tree | 9b1adbd7476b2b7242c5cac8ba5f14b78135812a /compiler/GHC/Tc/TyCl/Instance.hs | |
parent | a57cc7548fc66a712f6f6cffdbda0a9c3c498829 (diff) | |
download | haskell-265ead8a7401e20d75ed4e476805508ea695f37f.tar.gz |
Improve redundant-constraints warning
Previously, we reported things wrong with
f :: (Eq a, Ord a) => a -> Bool
f x = x == x
saying that Eq a was redundant. This is fixed now, along with
some simplification in Note [Replacement vs keeping]. There's
a tiny bit of extra complexity in setImplicationStatus, but
it's explained in Note [Tracking redundant constraints].
Close #20602
Diffstat (limited to 'compiler/GHC/Tc/TyCl/Instance.hs')
-rw-r--r-- | compiler/GHC/Tc/TyCl/Instance.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs index f6ebd07c04..26e1689e59 100644 --- a/compiler/GHC/Tc/TyCl/Instance.hs +++ b/compiler/GHC/Tc/TyCl/Instance.hs @@ -1604,7 +1604,8 @@ Answer: a SkolemInfo of (InstSC size), where 'size' is the size of the constraint whose superclass we are taking. A similarly when taking the superclass of an InstSC. This is implemented - in GHC.Tc.Solver.Canonical.newSCWorkFromFlavored + in GHC.Tc.Solver.Canonical.mk_strict_superclasses (in the + mk_given_loc helper function). Note [Silent superclass arguments] (historical interest only) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |