diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-07-28 10:55:25 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-19 18:48:14 -0400 |
commit | eb9bdaef6024558696e1e50b12d7fefb70483a9f (patch) | |
tree | c6d13c6f1fb212746a627397e13308c830e9635f /testsuite/tests/warnings | |
parent | 731c8d3bc5a84515793e5dadb26adf52f9280e13 (diff) | |
download | haskell-eb9bdaef6024558696e1e50b12d7fefb70483a9f.tar.gz |
Add right-to-left rule for pattern bindings
Fix #18323 by adding a few lines of code to handle non-recursive
pattern bindings. see GHC.Tc.Gen.Bind
Note [Special case for non-recursive pattern bindings]
Alas, this confused the pattern-match overlap checker; see #18323.
Note that this patch only affects pattern bindings like that
for (x,y) in this program
combine :: (forall a . [a] -> a) -> [forall a. a -> a]
-> ((forall a . [a] -> a), [forall a. a -> a])
breaks = let (x,y) = combine head ids
in x y True
We need ImpredicativeTypes for those [forall a. a->a] types to be
valid. And with ImpredicativeTypes the old, unprincipled "allow
unification variables to unify with a polytype" story actually
works quite well. So this test compiles fine (if delicatedly) with
old GHCs; but not with QuickLook unless we add this patch
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r-- | testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr b/testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr index aa02b8655a..c2ff69c9ef 100644 --- a/testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr +++ b/testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr @@ -59,7 +59,7 @@ CaretDiagnostics1.hs:13:7-11: error: | ^^^^^ CaretDiagnostics1.hs:(13,16)-(14,13): error: - • Couldn't match expected type ‘Char -> p0’ with actual type ‘()’ + • Couldn't match expected type ‘Char -> t0’ with actual type ‘()’ • The function ‘()’ is applied to one value argument, but its type ‘()’ has none In the expression: () '0' |