Fix #16008 with a pinch of addConsistencyConstraints
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 11 Dec 2018 11:22:49 +0000 (06:22 -0500)
committerRyan Scott <ryan.gl.scott@gmail.com>
Tue, 11 Dec 2018 11:22:49 +0000 (06:22 -0500)
commit3899966e4613ec18f365c28d64e9acc163cc1165
tree70f6386f09b8ad4cf70746ee86d3451b5c24fed4
parent4773b4308203a7f9d50a26831ccf56d8afe3c5e5
Fix #16008 with a pinch of addConsistencyConstraints

Summary:
#16008 happened because we forgot to typecheck nullary
associated type family instances in a way that's consistent with the
type variables bound by the parent class. Oops. Easily fixed with a
use of `checkConsistencyConstraints`.

Test Plan: make test TEST=T16008

Reviewers: simonpj, goldfire, bgamari

Reviewed By: goldfire

Subscribers: rwbarton, carter

GHC Trac Issues: #16008

Differential Revision: https://phabricator.haskell.org/D5435
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcTyClsDecls.hs
testsuite/tests/typecheck/should_compile/T16008.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T