Don't return empty initial uncovered set for an unsat context
authorMatthew Pickering <matthewtpickering@gmail.com>
Mon, 6 Feb 2017 01:27:41 +0000 (20:27 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 6 Feb 2017 01:27:42 +0000 (20:27 -0500)
commitadb565aa74582969bbcc3b411d6d518b1c76c3cf
treede4a0915d23be562311d3dd9dafe2588fddeaac1
parent0abe7361249b0b4dc43dc66547451da8916b30bf
Don't return empty initial uncovered set for an unsat context

Previously when the checker encountered an unsatisfiable term of type
context it would return an empty initial uncovered set. This caused all
pattern matches in the context to be reported as redudant.

This is arguably correct behaviour as they will never be reached but it
is better to recover and provide accurate warnings for these cases to
avoid error cascades. It would perhaps be better to report an error to
the user about an inacessible branch but this is certainly better than
many confusing redundant match warnings.

Reviewers: gkaracha, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3064
compiler/deSugar/Check.hs
testsuite/tests/ghci/scripts/Defer02.stderr
testsuite/tests/pmcheck/should_compile/T12957.hs [new file with mode: 0644]
testsuite/tests/pmcheck/should_compile/T12957.stderr [new file with mode: 0644]
testsuite/tests/pmcheck/should_compile/all.T
testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr [deleted file]
testsuite/tests/typecheck/should_fail/T10715.stderr [deleted file]
testsuite/tests/typecheck/should_fail/T8392a.stderr [deleted file]