Make a variant of mkCastErr for kind coercions
authorRyan Scott <ryan.gl.scott@gmail.com>
Fri, 6 Jul 2018 14:53:00 +0000 (10:53 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Fri, 6 Jul 2018 14:53:00 +0000 (10:53 -0400)
commit18cedbb55c7a0bdbfade4d28d3bb8927277df8d8
treeeeb2d251c14ff86e152d44c37eb585da0e2d5def
parent45f0026818402aa08398131507bc587ea4a2b387
Make a variant of mkCastErr for kind coercions

Summary:
I discovered when debugging #15346 that the Core Lint error
message for ill typed casts always mentions types of enclosed
//expressions//, even if the thing being casted is actually a type.
This generalizes `mkCastErr` a bit to allow it to give the proper
labelling for kind coercions.

Test Plan: Run on failing program in #15346, read the Core Lint error

Reviewers: goldfire, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4940
compiler/coreSyn/CoreLint.hs