diff options
author | Georgi Lyubenov <georgi.lyubenov@tweag.io> | 2022-09-09 15:24:03 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-02-21 18:35:56 -0500 |
commit | 172ff88fcac864a029d1cf77fbbe04c7a969d70d (patch) | |
tree | b13fbd18eea3ed72ba41b9ff825dc46836fc7f73 /testsuite/tests/rename/should_fail/all.T | |
parent | 8e765affde37197a6ebc174653171195fcc53003 (diff) | |
download | haskell-172ff88fcac864a029d1cf77fbbe04c7a969d70d.tar.gz |
GHC proposal 496 - Nullary record wildcards
This patch implements GHC proposal 496, which allows record wildcards
to be used for nullary constructors, e.g.
data A = MkA1 | MkA2 { fld1 :: Int }
f :: A -> Int
f (MkA1 {..}) = 0
f (MkA2 {..}) = fld1
To achieve this, we add arity information to the record field
environment, so that we can accept a constructor which has no fields
while continuing to reject non-record constructors with more than 1
field. See Note [Nullary constructors and empty record wildcards],
as well as the more general overview in Note [Local constructor info in the renamer],
both in the newly introduced GHC.Types.ConInfo module.
Fixes #22161
Diffstat (limited to 'testsuite/tests/rename/should_fail/all.T')
-rw-r--r-- | testsuite/tests/rename/should_fail/all.T | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index e15b13e9e3..6234f4a85d 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -110,6 +110,9 @@ test('T9436', normal, compile_fail, ['']) test('T9437', normal, compile_fail, ['']) test('T9077', normal, compile_fail, ['']) test('T9815', normal, compile_fail, ['']) +test('T9815b', [extra_files(['T9815.hs'])], multimod_compile_fail, ['T9815b', '-v0']) +test('T9815ghci', normal, ghci_script, ['T9815ghci.script']) +test('T9815bghci', normal, ghci_script, ['T9815bghci.script']) test('T9032', normal, |