Commit 3174beb6 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Comments about -Wredundant-constraints

parent afdde48b
...@@ -367,6 +367,7 @@ reportImplic ctxt implic@(Implic { ic_skols = tvs, ic_given = given ...@@ -367,6 +367,7 @@ reportImplic ctxt implic@(Implic { ic_skols = tvs, ic_given = given
_ -> [] _ -> []
warnRedundantConstraints :: ReportErrCtxt -> TcLclEnv -> SkolemInfo -> [EvVar] -> TcM () warnRedundantConstraints :: ReportErrCtxt -> TcLclEnv -> SkolemInfo -> [EvVar] -> TcM ()
-- See Note [Tracking redundant constraints] in TcSimplify
warnRedundantConstraints ctxt env info ev_vars warnRedundantConstraints ctxt env info ev_vars
| null redundant_evs | null redundant_evs
= return () = return ()
......
...@@ -1511,13 +1511,23 @@ works: ...@@ -1511,13 +1511,23 @@ works:
----- Shortcomings ----- Shortcomings
Consider (see Trac #9939) After I introduced -Wredundant-constraints there was extensive discussion
f2 :: (Eq a, Ord a) => a -> a -> Bool about cases where it reported a redundant constraint but the programmer
-- Ord a redundant, but Eq a is reported really wanted it. See
f2 x y = (x == y)
* #11370 (removed it from -Wdefault)
We report (Eq a) as redundant, whereas actually (Ord a) is. But it's * #10635 (removed it from -Wall as well)
really not easy to detect that! * #12142
* #11474, #10100 (class not used, but its fundeps are)
* #11099 (redundant, but still desired)
* #10183 (constraint necessary to exclude omitted case)
* #9939: f2 :: (Eq a, Ord a) => a -> a -> Bool
-- Ord a redundant, but Eq a is reported
f2 x y = (x == y)
We report (Eq a) as redundant, whereas actually (Ord a) is.
But it's really not easy to detect that!
Note [Cutting off simpl_loop] Note [Cutting off simpl_loop]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment