diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-05-25 16:11:10 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-06-13 15:58:37 -0400 |
commit | a31218f7737a65b6333ec7905e88dc094703f025 (patch) | |
tree | ac5c9a2a8161da0c44605ac4d7ffe5df1719461c /testsuite | |
parent | 7a773f169cfe072c7b29924c53075e4dfa4e2adb (diff) | |
download | haskell-a31218f7737a65b6333ec7905e88dc094703f025.tar.gz |
Use HsForAllTelescope to avoid inferred, visible foralls
Currently, `HsForAllTy` permits the combination of `ForallVis` and
`Inferred`, but you can't actually typecheck code that uses it
(e.g., `forall {a} ->`). This patch refactors `HsForAllTy` to use a
new `HsForAllTelescope` data type that makes a type-level distinction
between visible and invisible `forall`s such that visible `forall`s
do not track `Specificity`. That part of the patch is actually quite
small; the rest is simply changing consumers of `HsType` to
accommodate this new type.
Fixes #18235. Bumps the `haddock` submodule.
Diffstat (limited to 'testsuite')
3 files changed, 19 insertions, 20 deletions
diff --git a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr index 82b2faa84c..a2e4cd1e9e 100644 --- a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr +++ b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr @@ -368,13 +368,14 @@ ({ DumpRenamedAst.hs:19:11-33 } (HsForAllTy (NoExtField) - (ForallInvis) - [({ DumpRenamedAst.hs:19:18-19 } - (UserTyVar - (NoExtField) - (SpecifiedSpec) - ({ DumpRenamedAst.hs:19:18-19 } - {Name: xx})))] + (HsForAllInvis + (NoExtField) + [({ DumpRenamedAst.hs:19:18-19 } + (UserTyVar + (NoExtField) + (SpecifiedSpec) + ({ DumpRenamedAst.hs:19:18-19 } + {Name: xx})))]) ({ DumpRenamedAst.hs:19:22-33 } (HsFunTy (NoExtField) diff --git a/testsuite/tests/parser/should_compile/T15323.stderr b/testsuite/tests/parser/should_compile/T15323.stderr index c07f2d6a43..fd48dbf203 100644 --- a/testsuite/tests/parser/should_compile/T15323.stderr +++ b/testsuite/tests/parser/should_compile/T15323.stderr @@ -44,14 +44,15 @@ ({ T15323.hs:6:20-54 } (HsForAllTy (NoExtField) - (ForallInvis) - [({ T15323.hs:6:27 } - (UserTyVar - (NoExtField) - (SpecifiedSpec) - ({ T15323.hs:6:27 } - (Unqual - {OccName: v}))))] + (HsForAllInvis + (NoExtField) + [({ T15323.hs:6:27 } + (UserTyVar + (NoExtField) + (SpecifiedSpec) + ({ T15323.hs:6:27 } + (Unqual + {OccName: v}))))]) ({ T15323.hs:6:31-54 } (HsQualTy (NoExtField) diff --git a/testsuite/tests/typecheck/should_fail/ExplicitSpecificity8.stderr b/testsuite/tests/typecheck/should_fail/ExplicitSpecificity8.stderr index dcb79191d7..09c8e93a80 100644 --- a/testsuite/tests/typecheck/should_fail/ExplicitSpecificity8.stderr +++ b/testsuite/tests/typecheck/should_fail/ExplicitSpecificity8.stderr @@ -1,6 +1,3 @@ -ExplicitSpecificity8.hs:9:12: error: - • Unexpected inferred variable in visible forall binder: - forall {k} -> k -> Type - • In the kind ‘forall {k} -> k -> Type’ - In the data type declaration for ‘T2’ +ExplicitSpecificity8.hs:9:19: error: + Inferred type variables are not allowed here |