Commit d90023f2 authored by's avatar
Browse files

Fix egregious bug in implication constraints

Build an implication constraint if there is a non-trivial
refinement, even if there are no other 'given' constraints.

Test = gadt/set.hs
parent 905395be
......@@ -849,10 +849,11 @@ bindIrredsR loc qtvs co_vars reft givens irreds
-- The givens can include methods
-- See Note [Pruning the givens in an implication constraint]
-- If there are no 'givens', then it's safe to
-- If there are no 'givens' *and* the refinement is empty
-- (the refinement is like more givens), then it's safe to
-- partition the 'wanteds' by their qtvs, thereby trimming irreds
-- See Note [Freeness and implications]
; irreds' <- if null givens'
; irreds' <- if null givens' && isEmptyRefinement reft
then do
{ let qtv_set = mkVarSet qtvs
(frees, real_irreds) = partition (isFreeWrtTyVars qtv_set) irreds
Supports Markdown
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