summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-04-28 09:45:09 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2020-04-28 09:45:09 +0100
commitc5f45dc3b8ca9c8b1bf22c34cdc5e38e201ee7ac (patch)
tree886d11ae066cbf8140113fd68d1762e8907f1eec
parent0ac29c885fba7ed69de83a597cdbd03696c9ed13 (diff)
downloadhaskell-wip/T17873.tar.gz
Add tests for #17873wip/T17873
-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, [''])