summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt/T2587.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/gadt/T2587.hs')
-rw-r--r--testsuite/tests/gadt/T2587.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/gadt/T2587.hs b/testsuite/tests/gadt/T2587.hs
new file mode 100644
index 0000000000..bcd0a443ac
--- /dev/null
+++ b/testsuite/tests/gadt/T2587.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE GADTs, ExistentialQuantification #-}
+{-# OPTIONS_GHC -O -fno-warn-overlapping-patterns #-}
+
+-- Trac #2587
+-- Actually this bug related to free variables and
+-- type lets, but ostensibly it has a GADT flavour
+-- Hence being in the GADT directory.
+
+module GadtBug(bug) where
+
+data Existential = forall a . Existential (Gadt a)
+
+data Gadt a where Value :: Gadt Double
+
+bug = [ match undefined | ps <- undefined, _ <- ps ]
+ where
+ match (Existential _) = undefined
+ match (Existential _) = undefined