Add a failing test for T13644
authorMatthew Pickering <matthewtpickering@gmail.com>
Mon, 8 May 2017 21:46:39 +0000 (17:46 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 8 May 2017 21:46:55 +0000 (17:46 -0400)
The problem originates in TcPat.find_field_ty but I don't know how to
clearnly fix it.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13644

Differential Revision: https://phabricator.haskell.org/D3535

testsuite/tests/rename/should_fail/T13644.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T13644.stderr [new file with mode: 0644]
testsuite/tests/rename/should_fail/T13644A.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T13644B.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T13644C.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/all.T

diff --git a/testsuite/tests/rename/should_fail/T13644.hs b/testsuite/tests/rename/should_fail/T13644.hs
new file mode 100644 (file)
index 0000000..14a2049
--- /dev/null
@@ -0,0 +1,6 @@
+module T13644 where
+
+import T13644A
+
+baseENDECfuncs :: FuncId -> ()
+baseENDECfuncs FuncId{ name = nm } = undefined
diff --git a/testsuite/tests/rename/should_fail/T13644.stderr b/testsuite/tests/rename/should_fail/T13644.stderr
new file mode 100644 (file)
index 0000000..8443993
--- /dev/null
@@ -0,0 +1,6 @@
+
+T13644.hs:6:24: error:
+    • Constructor ‘FuncId’ does not have field ‘name’
+    • In the pattern: FuncId {name = nm}
+      In an equation for ‘baseENDECfuncs’:
+          baseENDECfuncs FuncId {name = nm} = undefined
diff --git a/testsuite/tests/rename/should_fail/T13644A.hs b/testsuite/tests/rename/should_fail/T13644A.hs
new file mode 100644 (file)
index 0000000..7838513
--- /dev/null
@@ -0,0 +1,10 @@
+module T13644A
+(
+  FuncId(FuncId)
+, module X
+)
+where
+
+import T13644C as X
+
+import T13644B
diff --git a/testsuite/tests/rename/should_fail/T13644B.hs b/testsuite/tests/rename/should_fail/T13644B.hs
new file mode 100644 (file)
index 0000000..72913e0
--- /dev/null
@@ -0,0 +1,3 @@
+module T13644B where
+
+data FuncId         = FuncId    { name       :: () }
diff --git a/testsuite/tests/rename/should_fail/T13644C.hs b/testsuite/tests/rename/should_fail/T13644C.hs
new file mode 100644 (file)
index 0000000..530d663
--- /dev/null
@@ -0,0 +1,3 @@
+module T13644C where
+
+data T = T { name :: () }
index 4782685..517d23d 100644 (file)
@@ -125,3 +125,4 @@ test('T12681', normal, multimod_compile_fail, ['T12681','-v0'])
 test('T12686', normal, compile_fail, [''])
 test('T11592', normal, compile_fail, [''])
 test('T12879', normal, compile_fail, [''])
+test('T13644', expect_broken(13644), multimod_compile_fail, ['T13644','-v0'])