diff options
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T20189.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T20189.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T20189.hs b/testsuite/tests/typecheck/should_fail/T20189.hs new file mode 100644 index 0000000000..9c7e7ceae8 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T20189.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE ImpredicativeTypes #-} +{-# LANGUAGE TypeFamilies #-} +module T20189 where + +y :: (t ~ (forall x . Show x => x -> IO ())) => t +y = _ + diff --git a/testsuite/tests/typecheck/should_fail/T20189.stderr b/testsuite/tests/typecheck/should_fail/T20189.stderr new file mode 100644 index 0000000000..df67fa4066 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T20189.stderr @@ -0,0 +1,12 @@ + +T20189.hs:6:5: error: + • Found hole: _ :: t + Where: ‘t’ is a rigid type variable bound by + the type signature for: + y :: forall t. (t ~ (forall x. Show x => x -> IO ())) => t + at T20189.hs:5:1-49 + • In an equation for ‘y’: y = _ + • Relevant bindings include y :: t (bound at T20189.hs:6:1) + Constraints include + t ~ (forall x. Show x => x -> IO ()) (from T20189.hs:5:1-49) + Valid hole fits include y :: t (bound at T20189.hs:6:1) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 18b07edc87..908edcfe27 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -627,3 +627,4 @@ test('OrdErr', normal, compile_fail, ['']) test('T20542', normal, compile_fail, ['']) test('T20588', [extra_files(['T20588.hs', 'T20588.hs-boot', 'T20588_aux.hs'])], multimod_compile_fail, ['T20588_aux.hs', '-v0']) test('T20588c', [extra_files(['T20588c.hs', 'T20588c.hs-boot', 'T20588c_aux.hs'])], multimod_compile_fail, ['T20588c_aux.hs', '-v0']) +test('T20189', normal, compile_fail, ['']) |