Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
3174beb6
Commit
3174beb6
authored
Oct 14, 2016
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments about -Wredundant-constraints
parent
afdde48b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcErrors.hs
+1
-0
compiler/typecheck/TcSimplify.hs
compiler/typecheck/TcSimplify.hs
+17
-7
No files found.
compiler/typecheck/TcErrors.hs
View file @
3174beb6
...
...
@@ -367,6 +367,7 @@ reportImplic ctxt implic@(Implic { ic_skols = tvs, ic_given = given
_
->
[]
warnRedundantConstraints
::
ReportErrCtxt
->
TcLclEnv
->
SkolemInfo
->
[
EvVar
]
->
TcM
()
-- See Note [Tracking redundant constraints] in TcSimplify
warnRedundantConstraints
ctxt
env
info
ev_vars
|
null
redundant_evs
=
return
()
...
...
compiler/typecheck/TcSimplify.hs
View file @
3174beb6
...
...
@@ -1511,13 +1511,23 @@ works:
----- Shortcomings
Consider (see Trac #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!
After I introduced -Wredundant-constraints there was extensive discussion
about cases where it reported a redundant constraint but the programmer
really wanted it. See
* #11370 (removed it from -Wdefault)
* #10635 (removed it from -Wall as well)
* #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]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment