diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-03-31 13:31:37 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-02 01:50:36 -0400 |
commit | 30a63e79c65b023497af4fe2347149382c71829d (patch) | |
tree | 581691ff95abe35df3bf26859eebb59dfe5db937 /testsuite/tests/th/all.T | |
parent | 4980200255dabf59ae537f10c55d19ef1a00bbdd (diff) | |
download | haskell-30a63e79c65b023497af4fe2347149382c71829d.tar.gz |
Fix two ASSERT buglets in reifyDataCon
Two `ASSERT`s in `reifyDataCon` were always using `arg_tys`, but
`arg_tys` is not meaningful for GADT constructors. In fact, it's
worse than non-meaningful, since using `arg_tys` when reifying a
GADT constructor can lead to failed `ASSERT`ions, as #17305
demonstrates.
This patch applies the simplest possible fix to the immediate
problem. The `ASSERT`s now use `r_arg_tys` instead of `arg_tys`, as
the former makes sure to give something meaningful for GADT
constructors. This makes the panic go away at the very least. There
is still an underlying issue with the way the internals of
`reifyDataCon` work, as described in
https://gitlab.haskell.org/ghc/ghc/issues/17305#note_227023, but we
leave that as future work, since fixing the underlying issue is
much trickier (see
https://gitlab.haskell.org/ghc/ghc/issues/17305#note_227087).
Diffstat (limited to 'testsuite/tests/th/all.T')
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 690270d732..127bdf665c 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -492,6 +492,7 @@ test('T16980a', normal, compile_fail, ['']) test('T17270a', extra_files(['T17270.hs']), multimod_compile, ['T17270', '-v0']) test('T17270b', extra_files(['T17270.hs']), multimod_compile, ['T17270', '-fenable-th-splice-warnings -v0']) test('T17296', normal, compile, ['-v0']) +test('T17305', normal, compile, ['-v0']) test('T17380', normal, compile_fail, ['']) test('T17394', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T17379a', normal, compile_fail, ['']) |