diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-01-09 16:20:46 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-01-09 16:25:53 +0000 |
commit | 1577908f2a9db0fcf6f749d40dd75481015f5497 (patch) | |
tree | 68ce132a2da4c3d914e3be219ddf8da2730f039c /testsuite/tests/partial-sigs/should_fail | |
parent | 448685c352542155f2e2361776c3b7f5e2a051ca (diff) | |
download | haskell-1577908f2a9db0fcf6f749d40dd75481015f5497.tar.gz |
Fix two more bugs in partial signatures
These were shown up by Trac #14643
Bug 1: if we had a single partial signature for
two functions
f, g :: forall a. _ -> a
then we made two different SigTvs but with the sane Name.
This was jolly confusing and ultimately led to deeply bogus
results with Any's appearing in the resulting program. Yikes.
Fix: clone the quantified variables in TcSigs.tcInstSig (as
indeed its name suggests).
Bug 2: we were not eliminating duplicate/superclass constraints
in the partial signatures of a mutually recursive group.
Easy to fix: we are already doing dup/superclass elim in
TcSimplify.decideQuantification. So we move the partial-sig
constraints there too.
Diffstat (limited to 'testsuite/tests/partial-sigs/should_fail')
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/T14040a.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/all.T | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/T14040a.stderr b/testsuite/tests/partial-sigs/should_fail/T14040a.stderr index b4f0e26822..ac9ad8a1bd 100644 --- a/testsuite/tests/partial-sigs/should_fail/T14040a.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T14040a.stderr @@ -21,7 +21,7 @@ T14040a.hs:34:8: error: -> Sing xs -> p (WeirdList z1) w1 xs -> p z1 w2 ('WeirdCons x xs)) - -> p a w3 wl’ + -> p a1 w3 wl’ to a visible type argument ‘(WeirdList z)’ • In the sixth argument of ‘pWeirdCons’, namely ‘(elimWeirdList @(WeirdList z) @xs @p xs pWeirdNil pWeirdCons)’ diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index b974ce8950..0f7496d1f5 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -3,7 +3,7 @@ test('AnnotatedConstraintNotForgotten', normal, compile_fail, ['']) test('Defaulting1MROff', normal, compile, ['']) test('ExtraConstraintsWildcardInExpressionSignature', normal, compile, ['']) test('ExtraConstraintsWildcardInPatternSignature', normal, compile_fail, ['']) -test('ExtraConstraintsWildcardInPatternSplice', normal, compile_fail, ['']) +test('ExtraConstraintsWildcardInPatternSplice', [req_interp, normal], compile_fail, ['']) test('ExtraConstraintsWildcardInTypeSpliceUsed', [extra_files(['ExtraConstraintsWildcardInTypeSplice.hs']), req_interp], multimod_compile_fail, |