diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-06-18 14:23:43 -0400 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-06-18 14:23:43 -0400 |
commit | 85731000d8b13476ed3c5bde22af610a27fb00f8 (patch) | |
tree | 84ee982aef942d7ad85ce1a5e3152ebf5b9751dd /testsuite/tests/deriving | |
parent | 559a0c5d5458401f54f3680f32675a958ccb0d2b (diff) | |
download | haskell-85731000d8b13476ed3c5bde22af610a27fb00f8.tar.gz |
Look through type synonyms in existential contexts when deriving Functor
Summary:
This amounts to using `exactTyCoVarsOfType` instead of
`tyCoVarsOfType` in the right place. I also fixed a similar issue for
`-XDatatypeContexts` while I was in town (but couldn't be bothered to add a
test for it).
Test Plan: make test TEST=T13813
Reviewers: austin, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie
GHC Trac Issues: #13813
Differential Revision: https://phabricator.haskell.org/D3635
Diffstat (limited to 'testsuite/tests/deriving')
-rw-r--r-- | testsuite/tests/deriving/should_compile/T13813.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_compile/all.T | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T13813.hs b/testsuite/tests/deriving/should_compile/T13813.hs new file mode 100644 index 0000000000..e63869cb97 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T13813.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE StandaloneDeriving #-} +module T13813 where + +import GHC.Exts (Constraint) + +type C (a :: Constraint) b = a + +data T a b = C (Show a) b => MkT b +deriving instance Functor (T a) diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index 36476d5f9c..d1615ab647 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -91,3 +91,4 @@ test('T13297', normal, compile, ['']) test('T13758', normal, compile, ['']) test('drv-empty-data', [normalise_errmsg_fun(just_the_deriving)],compile, ['-ddump-deriv -dsuppress-uniques']) test('drv-phantom', [normalise_errmsg_fun(just_the_deriving)],compile, ['-ddump-deriv -dsuppress-uniques']) +test('T13813', normal, compile, ['']) |