diff --git a/testsuite/tests/typecheck/should_compile/T17873.hs b/testsuite/tests/typecheck/should_compile/T17873.hs new file mode 100644 index 0000000000000000000000000000000000000000..3372f62bfd81f3dfef986e1b3bf9c1678751f917 --- /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 a7825b9f5441cd85c142fc26bdad8cc85a2b06f3..03389993ddffc79ed920607754e1ec38e43c6416 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, [''])