diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-10-29 15:18:22 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-30 21:09:04 -0400 |
commit | 10b3cb33648e8ca6853d09814f79bdfa71d72f36 (patch) | |
tree | 0b55b00cb52d709f500a99e30d27907b4b615a2b | |
parent | 72f7ac9ad66b886f4ea9569446e20aa4f97890e4 (diff) | |
download | haskell-wip/T17267-test.tar.gz |
Add another test for #17267wip/T17267-test
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, ['']) |