Fill in associated type defaults with DeriveAnyClass
authorRyanGlScott <ryan.gl.scott@gmail.com>
Sat, 3 Oct 2015 18:06:48 +0000 (20:06 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sat, 3 Oct 2015 18:36:34 +0000 (20:36 +0200)
commit2f74be9c8af1e167b21df1a27b96b6626cd446a9
treeb993d2b8c2efdc00081f6243bc744fd0d2ad3bae
parent0eb8fcd94b29ee9997b386e64203037bdf2aaa04
Fill in associated type defaults with DeriveAnyClass

Summary:
Unlike `-XDefaultSignatures`, `-XDeriveAnyClass` would not fill in
associated type family defaults when deriving a class which contained
them.

In order to fix this properly, `tcATDefault` needed to be used from
`TcGenDeriv`. To avoid a module import cycle, `tcATDefault` was moved
from `TcInstDcls` to `TcClsDcl`.

Fixes #10361.

Test Plan: ./validate

Reviewers: kosmikus, dreixel, bgamari, austin, simonpj

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1283

GHC Trac Issues: #10361
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcInstDcls.hs
docs/users_guide/7.12.1-notes.rst
docs/users_guide/glasgow_exts.rst
testsuite/tests/generics/T10361a.hs [new file with mode: 0644]
testsuite/tests/generics/T10361b.hs [new file with mode: 0644]
testsuite/tests/generics/all.T