[commit: ghc] wip/T11970: test (47647d8)
git at git.haskell.org
git at git.haskell.org
Fri Jun 17 20:10:59 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T11970
Link : http://ghc.haskell.org/trac/ghc/changeset/47647d889678bf5fe66e5d8ca7f8e225d40c5212/ghc
>---------------------------------------------------------------
commit 47647d889678bf5fe66e5d8ca7f8e225d40c5212
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date: Sat May 21 23:50:59 2016 +0100
test
>---------------------------------------------------------------
47647d889678bf5fe66e5d8ca7f8e225d40c5212
testsuite/tests/module/T11970.hs | 19 +++++++++++++++++++
testsuite/tests/module/T11970.stderr | 12 ++++++++++++
2 files changed, 31 insertions(+)
diff --git a/testsuite/tests/module/T11970.hs b/testsuite/tests/module/T11970.hs
new file mode 100644
index 0000000..3c90c69
--- /dev/null
+++ b/testsuite/tests/module/T11970.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE PatternSynonyms #-}
+
+module T11970(B(recSel), Foo((--.->)), C(C,P,x,Q, B, recSel)) where
+
+pattern D = Nothing
+
+newtype B = B { recSel :: Int }
+
+class Foo a where
+ type (--.->) a
+
+newtype C = C Int
+
+pattern P x = C x
+
+pattern Q{x} = C x
diff --git a/testsuite/tests/module/T11970.stderr b/testsuite/tests/module/T11970.stderr
new file mode 100644
index 0000000..c6799a1
--- /dev/null
+++ b/testsuite/tests/module/T11970.stderr
@@ -0,0 +1,12 @@
+
+T11970.hs:6:40: error:
+ • The type constructor ‘C’ is not the parent of the data constructor ‘B’.
+ Data constructors can only be exported with their parent type constructor.
+ Parent: B
+ • In the export: C(C, P, x, Q, B, recSel)
+
+T11970.hs:6:40: error:
+ • The type constructor ‘C’ is not the parent of the record selector ‘recSel’.
+ Record selectors can only be exported with their parent type constructor.
+ Parent: B
+ • In the export: C(C, P, x, Q, B, recSel)
More information about the ghc-commits
mailing list