summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_compile/all.T
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-01-05 13:20:48 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-01-06 14:21:13 +0000
commit32973bf3c2f6fe00e01b44a63ac1904080466938 (patch)
treedcefa6b0b92f2cefda9c0ce8944169da0036d598 /testsuite/tests/partial-sigs/should_compile/all.T
parentda9b2ec3e19edb1de0e73e8f32aa0443743f072c (diff)
downloadhaskell-32973bf3c2f6fe00e01b44a63ac1904080466938.tar.gz
Major patch to add -fwarn-redundant-constraints
The idea was promted by Trac #9939, but it was Christmas, so I did some recreational programming that went much further. The idea is to warn when a constraint in a user-supplied context is redundant. Everything is described in detail in Note [Tracking redundant constraints] in TcSimplify. Main changes: * The new ic_status field in an implication, of type ImplicStatus. It replaces ic_insol, and includes information about redundant constraints. * New function TcSimplify.setImplicationStatus sets the ic_status. * TcSigInfo has sig_report_redundant field to say whenther a redundant constraint should be reported; and similarly the FunSigCtxt constructor of UserTypeCtxt * EvBinds has a field eb_is_given, to record whether it is a given or wanted binding. Some consequential chagnes to creating an evidence binding (so that we record whether it is given or wanted). * AbsBinds field abs_ev_binds is now a *list* of TcEvBiinds; see Note [Typechecking plan for instance declarations] in TcInstDcls * Some significant changes to the type checking of instance declarations; Note [Typechecking plan for instance declarations] in TcInstDcls. * I found that TcErrors.relevantBindings was failing to zonk the origin of the constraint it was looking at, and hence failing to find some relevant bindings. Easy to fix, and orthogonal to everything else, but hard to disentangle. Some minor refactorig: * TcMType.newSimpleWanteds moves to Inst, renamed as newWanteds * TcClassDcl and TcInstDcls now have their own code for typechecking a method body, rather than sharing a single function. The shared function (ws TcClassDcl.tcInstanceMethodBody) didn't have much code and the differences were growing confusing. * Add new function TcRnMonad.pushLevelAndCaptureConstraints, and use it * Add new function Bag.catBagMaybes, and use it in TcSimplify
Diffstat (limited to 'testsuite/tests/partial-sigs/should_compile/all.T')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/all.T2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T
index 52a532f32f..e83e070dcd 100644
--- a/testsuite/tests/partial-sigs/should_compile/all.T
+++ b/testsuite/tests/partial-sigs/should_compile/all.T
@@ -29,7 +29,7 @@ test('HigherRank2', normal, compile, ['-ddump-types -fno-warn-partial-type-signa
test('LocalDefinitionBug', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('Meltdown', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
# Bug
-test('MonoLocalBinds', expect_fail, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
+test('MonoLocalBinds', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('NamedTyVar', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('ParensAroundContext', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('PatBind', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])