summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2022-02-02 14:21:17 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-07 14:05:41 -0500
commit14e900989ce1e2de733fbbcebe853ae363703e3a (patch)
treecd876e58ab44dda24d91314703c329f8974aa339 /testsuite/tests/typecheck
parent706deee0524ca6af26c8b8d5cff17a6e401a2c18 (diff)
downloadhaskell-14e900989ce1e2de733fbbcebe853ae363703e3a.tar.gz
Always generalise top-level bindings
Fix #21023 by always generalising top-level binding; change the documentation of -XMonoLocalBinds to match.
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/should_compile/T21023.hs5
-rw-r--r--testsuite/tests/typecheck/should_compile/T21023.stderr5
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T21023.hs b/testsuite/tests/typecheck/should_compile/T21023.hs
new file mode 100644
index 0000000000..322ba786b1
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T21023.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE MonoLocalBinds #-}
+
+module T21023( f ) where
+ x = 5
+ f v = (v,x)
diff --git a/testsuite/tests/typecheck/should_compile/T21023.stderr b/testsuite/tests/typecheck/should_compile/T21023.stderr
new file mode 100644
index 0000000000..fa7034f598
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T21023.stderr
@@ -0,0 +1,5 @@
+TYPE SIGNATURES
+ f :: forall {a}. a -> (a, Integer)
+ x :: Integer
+Dependent modules: []
+Dependent packages: [base-4.16.0.0]
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 6d9ae4c566..24574892e7 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -819,3 +819,5 @@ test('FloatFDs', normal, compile, [''])
test('ImplicitParamFDs', normal, compile, [''])
test('T18406b', normal, compile, ['-ddump-tc -fprint-explicit-foralls -dsuppress-uniques -fprint-typechecker-elaboration'])
test('T18529', normal, compile, ['-ddump-tc -fprint-explicit-foralls -dsuppress-uniques -fprint-typechecker-elaboration'])
+test('T21023', normal, compile, ['-ddump-types'])
+