summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-04-28 09:45:09 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-30 01:58:15 -0400
commit5bdfdd139e5aff57631e9f1c6654dc7b8590c63f (patch)
treef5629e61674e5c13927e3befb13880616c1921b5
parentf4d3773c7f4209cd3a0495ab9a29b978da48e2ff (diff)
downloadhaskell-5bdfdd139e5aff57631e9f1c6654dc7b8590c63f.tar.gz
Add tests for #17873
-rw-r--r--testsuite/tests/typecheck/should_compile/T17873.hs15
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T17873.hs b/testsuite/tests/typecheck/should_compile/T17873.hs
new file mode 100644
index 0000000000..3372f62bfd
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T17873.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE ImplicitParams #-}
+
+module T17873 where
+
+-- With GHC 8.8 this failed with a nonsense message
+-- Couldn't match type ‘?x::Bool -> Bool’ with ‘Bool’
+-- Expected type: Bool -> Bool -> Bool
+-- Actual type: (?x::Bool -> Bool) => Bool -> Bool
+
+-- With eager instantiation, it's fine.
+
+getx :: (?x :: Bool -> Bool) => Bool -> Bool
+getx = ?x
+
+z3 = (let ?x = not in getx) False
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index a7825b9f54..03389993dd 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -705,3 +705,4 @@ test('T18005', normal, compile, [''])
test('T18023', normal, compile, [''])
test('T18036', normal, compile, [''])
test('T18036a', normal, compile, [''])
+test('T17873', normal, compile, [''])