Test Trac #12229
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 24 Jun 2016 10:31:32 +0000 (11:31 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 24 Jun 2016 10:31:42 +0000 (11:31 +0100)
testsuite/tests/rename/should_fail/T12229.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T12229.stderr [new file with mode: 0644]
testsuite/tests/rename/should_fail/all.T

diff --git a/testsuite/tests/rename/should_fail/T12229.hs b/testsuite/tests/rename/should_fail/T12229.hs
new file mode 100644 (file)
index 0000000..5f5bea4
--- /dev/null
@@ -0,0 +1,11 @@
+{-# LANGUAGE RecordWildCards #-}
+
+module T12229 where
+
+data T = MkT { x, pi :: Float }
+
+f x = MkT { .. }  -- 'pi' is not initialised, because
+                  -- there is no local binding
+
+g x pi = MkT { .. }  -- 'pi' is initialised
+
diff --git a/testsuite/tests/rename/should_fail/T12229.stderr b/testsuite/tests/rename/should_fail/T12229.stderr
new file mode 100644 (file)
index 0000000..4fc8678
--- /dev/null
@@ -0,0 +1,5 @@
+
+T12229.hs:7:7: warning: [-Wmissing-fields (in -Wdefault)]
+    • Fields of ‘MkT’ not initialised: pi
+    • In the expression: MkT {..}
+      In an equation for ‘f’: f x = MkT {..}
index 78b80e8..3ddfea2 100644 (file)
@@ -138,3 +138,4 @@ test('T10781', normal, compile_fail, [''])
 test('T11071', normal, compile_fail, [''])
 test('T11071a', normal, compile_fail, [''])
 test('T11663', normal, compile_fail, [''])
+test('T12229', normal, compile, [''])