Fix #12430 by expanding type synonyms in injTyVarsOfType
authorRyan Scott <ryan.gl.scott@gmail.com>
Mon, 15 Oct 2018 17:48:21 +0000 (13:48 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 15 Oct 2018 21:59:20 +0000 (17:59 -0400)
commit26e81e90281685af37c8f2cf149c242b4039117a
tree7a3af42bd72026255434f5e0322fb3938f19e51a
parent0b0cb484eb0b51bf5485dfadff7cd8a079ceb16e
Fix #12430 by expanding type synonyms in injTyVarsOfType

We weren't expanding type synonyms when determining the
injective type variables of a type, leading to certain non-injective
families being mistakenly labeled as injective (#12430). Easily fixed
with a tactical use of `coreView`.

Test Plan: make test TEST=T12430

Reviewers: bgamari, goldfire

Reviewed By: goldfire

Subscribers: goldfire, rwbarton, carter

GHC Trac Issues: #12430

Differential Revision: https://phabricator.haskell.org/D5228
compiler/typecheck/FamInst.hs
testsuite/tests/typecheck/should_fail/T12430.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T12430.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T