[commit: ghc] master: Add a test for Trac #15523 (9f932d8)
git at git.haskell.org
git at git.haskell.org
Wed Aug 15 15:58:19 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/9f932d8a609f54127510a432f399b9487ea84d6a/ghc
>---------------------------------------------------------------
commit 9f932d8a609f54127510a432f399b9487ea84d6a
Author: Krzysztof Gogolewski <krz.gogolewski at gmail.com>
Date: Wed Aug 15 16:49:32 2018 +0200
Add a test for Trac #15523
Summary: Fortunately the bug is not present in master.
Test Plan: make test TEST=T15523
Reviewers: bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, carter
GHC Trac Issues: #15523
Differential Revision: https://phabricator.haskell.org/D5070
>---------------------------------------------------------------
9f932d8a609f54127510a432f399b9487ea84d6a
testsuite/tests/typecheck/should_fail/T15523.hs | 6 ++++++
testsuite/tests/typecheck/should_fail/T15523.stderr | 6 ++++++
testsuite/tests/typecheck/should_fail/all.T | 1 +
3 files changed, 13 insertions(+)
diff --git a/testsuite/tests/typecheck/should_fail/T15523.hs b/testsuite/tests/typecheck/should_fail/T15523.hs
new file mode 100644
index 0000000..89b1bb4
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T15523.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE StrictData #-}
+
+module T15523 where
+
+newtype Duration = Foo
+data Literal = LitDuration Duration
diff --git a/testsuite/tests/typecheck/should_fail/T15523.stderr b/testsuite/tests/typecheck/should_fail/T15523.stderr
new file mode 100644
index 0000000..83b7cdb
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T15523.stderr
@@ -0,0 +1,6 @@
+
+T15523.hs:5:20: error:
+ • The constructor of a newtype must have exactly one field
+ but ‘Foo’ has none
+ • In the definition of data constructor ‘Foo’
+ In the newtype declaration for ‘Duration’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 72023d2..962ffb7 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -477,3 +477,4 @@ test('T15067', normal, compile_fail, [''])
test('T15330', normal, compile_fail, [''])
test('T15361', normal, compile_fail, [''])
test('T15438', normal, compile_fail, [''])
+test('T15523', normal, compile_fail, ['-O'])
More information about the ghc-commits
mailing list