[commit: ghc] master: Fix #16002 by moving a validity check to the renamer (28f41f1)
git at git.haskell.org
git at git.haskell.org
Fri Dec 21 04:29:23 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7/ghc
>---------------------------------------------------------------
commit 28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Thu Dec 20 23:00:21 2018 -0500
Fix #16002 by moving a validity check to the renamer
Summary:
The validity check which rejected things like:
```lang=haskell
type family B x where
A x = x
```
Used to live in the typechecker. But it turns out that this validity
check was //only// being run on closed type families without CUSKs!
This meant that GHC would silently accept something like this:
```lang=haskell
type family B (x :: *) :: * where
A x = x
```
This patch fixes the issue by moving this validity check to the
renamer, where we can be sure that the check will //always// be run.
Test Plan: make test TEST=T16002
Reviewers: simonpj, bgamari
Reviewed By: simonpj
Subscribers: goldfire, rwbarton, carter
GHC Trac Issues: #16002
Differential Revision: https://phabricator.haskell.org/D5420
>---------------------------------------------------------------
28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7
compiler/rename/RnSource.hs | 57 ++++++++++++++++------
compiler/typecheck/TcTyClsDecls.hs | 9 ----
.../indexed-types/should_fail/Overlap5.stderr | 4 +-
testsuite/tests/rename/should_fail/T16002.hs | 6 +++
testsuite/tests/rename/should_fail/T16002.stderr | 6 +++
testsuite/tests/rename/should_fail/all.T | 1 +
.../tests/typecheck/should_fail/T11623.stderr | 8 +--
7 files changed, 62 insertions(+), 29 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7
More information about the ghc-commits
mailing list