diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-10-29 15:18:22 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-01 04:56:38 -0400 |
commit | d2471964ef06219811c03c2ed0710f9ff98e97ef (patch) | |
tree | ef56b832f3d30c07387eab8feb82486ce71b2036 | |
parent | 35c99e720ddbb3ce1355d63c9fb68ef156b9f586 (diff) | |
download | haskell-d2471964ef06219811c03c2ed0710f9ff98e97ef.tar.gz |
Add another test for #17267
This one came in a comment from James Payor
-rw-r--r-- | testsuite/tests/quantified-constraints/T17267e.hs | 27 | ||||
-rw-r--r-- | testsuite/tests/quantified-constraints/T17267e.stderr | 13 | ||||
-rw-r--r-- | testsuite/tests/quantified-constraints/all.T | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T17267e.hs b/testsuite/tests/quantified-constraints/T17267e.hs new file mode 100644 index 0000000000..0b00995ab2 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T17267e.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE MonoLocalBinds #-} + +module Main where + +class Show a => Thing a b +instance Show a => Thing a b + +class (Show a => Thing a ()) => PseudoShow a b +instance PseudoShow a b + +pseudoShow :: PseudoShow a () => a -> String +pseudoShow = show + + +{- + [G] PseudoShow a () +(and hence by SC) + [G] Show a => Thing a () +(and hence by SC) + [G] Show a => Show a +The latter loops +-} + diff --git a/testsuite/tests/quantified-constraints/T17267e.stderr b/testsuite/tests/quantified-constraints/T17267e.stderr new file mode 100644 index 0000000000..b497fa1009 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T17267e.stderr @@ -0,0 +1,13 @@ + +T17267e.hs:1:1: error: + The IO action ‘main’ is not defined in module ‘Main’ + +T17267e.hs:16:14: error: + • Reduction stack overflow; size = 201 + When simplifying the following type: Show a + Use -freduction-depth=0 to disable this check + (any upper bound you could choose might fail unpredictably with + minor updates to GHC, so disabling the check is recommended if + you're sure that type checking should terminate) + • In the expression: show + In an equation for ‘pseudoShow’: pseudoShow = show diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T index 7fb728654a..6a1d41eeee 100644 --- a/testsuite/tests/quantified-constraints/all.T +++ b/testsuite/tests/quantified-constraints/all.T @@ -26,3 +26,4 @@ test('T17267a', normal, compile_fail, ['']) test('T17267b', normal, compile_fail, ['']) test('T17267c', normal, compile_fail, ['']) test('T17267d', normal, compile_and_run, ['']) +test('T17267e', normal, compile_fail, ['']) |