From 181da0c3e14dc2794f1a68766fc2c46c8948f527 Mon Sep 17 00:00:00 2001
From: simonpj <unknown>
Date: Wed, 30 Jun 1999 09:49:55 +0000
Subject: [PATCH] [project @ 1999-06-30 09:49:55 by simonpj] Add a test for
 deriving Show (f (f a)); makes Hugs hang

---
 ghc/tests/deriving/should_fail/drvfail001.hs  | 25 +++++++++++++++++++
 .../deriving/should_fail/drvfail001.stderr    |  7 ++++++
 2 files changed, 32 insertions(+)
 create mode 100644 ghc/tests/deriving/should_fail/drvfail001.hs
 create mode 100644 ghc/tests/deriving/should_fail/drvfail001.stderr

diff --git a/ghc/tests/deriving/should_fail/drvfail001.hs b/ghc/tests/deriving/should_fail/drvfail001.hs
new file mode 100644
index 000000000000..aa7867f34f63
--- /dev/null
+++ b/ghc/tests/deriving/should_fail/drvfail001.hs
@@ -0,0 +1,25 @@
+{-  From: Ian Bayley 
+    Sent: Tuesday, June 29, 1999 3:39 PM
+    To: hugs-bugs@haskell.org
+    Subject: Show for higher-order nested datatypes
+    
+    
+    Is "deriving Show" meant to work for higher-order nested datatypes ?
+    Hugs hangs when loading in the following file:
+-}
+
+module Foo where
+
+type SqMat a = SM Nil a
+
+data SM f a = ZeroS (f (f a)) | SuccS (SM (Cons f) a) 
+		       deriving Show
+
+
+data Nil a = MkNil deriving Show
+
+data Cons f a = MkCons a (f a)
+		       deriving Show
+
+
+
diff --git a/ghc/tests/deriving/should_fail/drvfail001.stderr b/ghc/tests/deriving/should_fail/drvfail001.stderr
new file mode 100644
index 000000000000..887f7cd25ed0
--- /dev/null
+++ b/ghc/tests/deriving/should_fail/drvfail001.stderr
@@ -0,0 +1,7 @@
+
+drvfail001.hs:11:
+    No instance for `Show (f (f a))'
+    When deriving classes for `SM'
+
+Compilation had errors
+
-- 
GitLab