diff options
author | M Farkas-Dyck <strake888@gmail.com> | 2022-03-13 16:10:21 -0800 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-09-19 09:07:05 -0400 |
commit | c1f81b38625a5fea7fb8160a3a62ae6be078a7b1 (patch) | |
tree | 7c151bc71e83e587df97265fd58c7a1b45574f8d /testsuite/tests/parser/should_fail | |
parent | 7574659452a864e762fa812cb38cf15f70d85617 (diff) | |
download | haskell-c1f81b38625a5fea7fb8160a3a62ae6be078a7b1.tar.gz |
Scrub partiality about `NewOrData`.
Rather than a list of constructors and a `NewOrData` flag, we define `data DataDefnCons a = NewTypeCon a | DataTypeCons [a]`, which enforces a newtype to have exactly one constructor.
Closes #22070.
Bump haddock submodule.
Diffstat (limited to 'testsuite/tests/parser/should_fail')
-rw-r--r-- | testsuite/tests/parser/should_fail/T22070.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T22070.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/all.T | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/T22070.hs b/testsuite/tests/parser/should_fail/T22070.hs new file mode 100644 index 0000000000..3d03eeca53 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T22070.hs @@ -0,0 +1,3 @@ +module T22070 where + +newtype FooBar = Foo | Bar diff --git a/testsuite/tests/parser/should_fail/T22070.stderr b/testsuite/tests/parser/should_fail/T22070.stderr new file mode 100644 index 0000000000..71ff16e7b3 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T22070.stderr @@ -0,0 +1,4 @@ + +T22070.hs:3:1: error: [GHC-05380] + A newtype must have exactly one constructor, but ‘FooBar’ has two + In the newtype declaration for ‘FooBar’ diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 4d70833bed..8713d91f2b 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -208,3 +208,4 @@ test('OpaqueParseFail4', normal, compile_fail, ['']) test('T20385A', normal, compile_fail, ['']) test('T20385B', normal, compile_fail, ['']) test('T16999', normal, compile_fail, ['']) +test('T22070', normal, compile_fail, ['']) |