diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2021-04-29 17:35:47 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-30 23:22:48 -0400 |
commit | 460afbe676715e4b8d75af79e9700ceebcf62eed (patch) | |
tree | 7064b263e14dcc9f7e4979f3becdf9775d8bd715 /testsuite/tests/typecheck/should_compile | |
parent | 6623790d7486b2b1a1863538dbb2b65234ecaaa6 (diff) | |
download | haskell-460afbe676715e4b8d75af79e9700ceebcf62eed.tar.gz |
Bring tcTyConScopedTyVars into scope in tcClassDecl2
It is possible that the type variables bound by a class header will map to
something different in the typechecker in the presence of
`StandaloneKindSignatures`. `tcClassDecl2` was not aware of this, however,
leading to #19738. To fix it, in `tcTyClDecls` we map each class `TcTyCon` to
its `tcTyConScopedTyVars` as a `ClassScopedTVEnv`. We then plumb that
`ClassScopedTVEnv` to `tcClassDecl2` where it can be used.
Fixes #19738.
Diffstat (limited to 'testsuite/tests/typecheck/should_compile')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T19738.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T19738.hs b/testsuite/tests/typecheck/should_compile/T19738.hs new file mode 100644 index 0000000000..4c704b6d5e --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T19738.hs @@ -0,0 +1,11 @@ +module T19738 where + +import Data.Kind + +type P :: k -> Type +data P a = MkP + +type T :: k -> Constraint +class T (a :: j) where + f :: P a + f = MkP @j @a diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 9b3753848f..9d0225a6c2 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -783,4 +783,5 @@ test('T18467', normal, compile, ['']) test('T19315', normal, compile, ['']) test('T19535', normal, compile, ['']) +test('T19738', normal, compile, ['']) test('T19742', normal, compile, ['']) |