diff options
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T17873.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
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, ['']) |