diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-12-20 23:00:21 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-12-20 23:00:21 -0500 |
commit | 28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7 (patch) | |
tree | 6b67b7d02b2b69edd650c74a7f69e6c1281da80a /testsuite/tests/typecheck/should_fail | |
parent | 5f2a8793514918eaa670347ce0d95dfdbbdd4f4d (diff) | |
download | haskell-28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7.tar.gz |
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
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T11623.stderr | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T11623.stderr b/testsuite/tests/typecheck/should_fail/T11623.stderr index 0f6253f103..78be1651e2 100644 --- a/testsuite/tests/typecheck/should_fail/T11623.stderr +++ b/testsuite/tests/typecheck/should_fail/T11623.stderr @@ -1,6 +1,6 @@ T11623.hs:5:23: error: - • Mismatched type name in type family instance. - Expected: T - Actual: Maybe - • In the type family declaration for ‘T’ + Mismatched type name in type family instance. + Expected: T + Actual: Maybe + In the declaration for type family ‘T’ |