summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/prog005
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rename/prog005')
-rw-r--r--testsuite/tests/rename/prog005/Makefile3
-rw-r--r--testsuite/tests/rename/prog005/VersionGraphClient.hs8
-rw-r--r--testsuite/tests/rename/prog005/VersionGraphClient.hs-boot3
-rw-r--r--testsuite/tests/rename/prog005/View.hs42
-rw-r--r--testsuite/tests/rename/prog005/ViewType.hs12
-rw-r--r--testsuite/tests/rename/prog005/test.T7
6 files changed, 75 insertions, 0 deletions
diff --git a/testsuite/tests/rename/prog005/Makefile b/testsuite/tests/rename/prog005/Makefile
new file mode 100644
index 0000000000..9101fbd40a
--- /dev/null
+++ b/testsuite/tests/rename/prog005/Makefile
@@ -0,0 +1,3 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/rename/prog005/VersionGraphClient.hs b/testsuite/tests/rename/prog005/VersionGraphClient.hs
new file mode 100644
index 0000000000..3aad9f5180
--- /dev/null
+++ b/testsuite/tests/rename/prog005/VersionGraphClient.hs
@@ -0,0 +1,8 @@
+module VersionGraphClient(
+ VersionGraphClient,
+
+ ) where
+
+import ViewType
+
+newtype VersionGraphClient = VersionGraphClient Int
diff --git a/testsuite/tests/rename/prog005/VersionGraphClient.hs-boot b/testsuite/tests/rename/prog005/VersionGraphClient.hs-boot
new file mode 100644
index 0000000000..6bca0bbf5e
--- /dev/null
+++ b/testsuite/tests/rename/prog005/VersionGraphClient.hs-boot
@@ -0,0 +1,3 @@
+module VersionGraphClient where
+
+data VersionGraphClient
diff --git a/testsuite/tests/rename/prog005/View.hs b/testsuite/tests/rename/prog005/View.hs
new file mode 100644
index 0000000000..c14d301c3d
--- /dev/null
+++ b/testsuite/tests/rename/prog005/View.hs
@@ -0,0 +1,42 @@
+{-
+Bug report submitted by George Russell, 1/10/2004:
+
+With both ghc6.2 and 6.2.20040915 on Linux, ghc --make cannot compile
+the attached files and produces a confusing error message.
+
+ # ghc --make View.hs
+Chasing modules from: View.hs
+Compiling ViewType ( ./ViewType.hs, ./ViewType.o )
+Compiling VersionGraphClient ( ./VersionGraphClient.hs, ./VersionGraphClient.o )Compiling View ( View.hs, View.o )
+
+View.hs:14:
+ Couldn't match `VersionGraphClient' against `VersionGraphClient'
+ Expected type: VersionGraphClient
+ Inferred type: VersionGraphClient
+ In the `graphClient1' field of a record
+ In the record construction: View {graphClient1 = graphClient}
+
+However ghc without make has no problems.
+
+# ghc -c ViewType.hs
+# ghc -c VersionGraphClient.hs
+# ghc -c View.hs
+-}
+
+-- | This module defines the fundamental structure of the (untyped)
+-- objects in a repository.
+--
+-- We depend circularly on CodedValue.hs. This module is compiled
+-- first and uses CodedValue.hi-boot.
+module View(
+ ) where
+
+import ViewType
+import VersionGraphClient
+
+createView :: VersionGraphClient -> IO View
+createView graphClient =
+ do
+ return (View {
+ graphClient1 = graphClient
+ })
diff --git a/testsuite/tests/rename/prog005/ViewType.hs b/testsuite/tests/rename/prog005/ViewType.hs
new file mode 100644
index 0000000000..8e9dd3cd49
--- /dev/null
+++ b/testsuite/tests/rename/prog005/ViewType.hs
@@ -0,0 +1,12 @@
+module ViewType(
+
+ View(..),
+ ) where
+
+
+import {-# SOURCE #-} VersionGraphClient
+
+data View = View {
+ graphClient1 :: VersionGraphClient
+ }
+
diff --git a/testsuite/tests/rename/prog005/test.T b/testsuite/tests/rename/prog005/test.T
new file mode 100644
index 0000000000..35769bd2bb
--- /dev/null
+++ b/testsuite/tests/rename/prog005/test.T
@@ -0,0 +1,7 @@
+test('rename.prog005',
+ [only_compiler_types(['ghc']),
+ extra_clean(['VersionGraphClient.o-boot','VersionGraphClient.hi-boot',
+ 'VersionGraphClient.hi', 'VersionGraphClient.o',
+ 'ViewType.hi', 'ViewType.o', 'View.hi', 'View.o'])],
+ multimod_compile,
+ ['View', '-v0'])