Do not bind coercion variables in SpecConstr rules
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 12 Oct 2017 10:00:19 +0000 (11:00 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 12 Oct 2017 11:47:47 +0000 (12:47 +0100)
commitfb050a330ad202c1eb43038dc18cca2a5be26f4a
treebd0698180fce1b4d215b9dc4f64cae617c96c57d
parent15aefb48d946f01b4bc348c34ac4aa8113de45fa
Do not bind coercion variables in SpecConstr rules

Trac #14270 showed that SpecConstr could cause nasty Lint failures
if it generates a RULE that binds coercion varables.  See

 * Note [SpecConstr and casts], and
 * the test simplCore/should_compile/T14270.

This doesn't feel like the final word to me, because somehow the
specialisation "ought" to work.  So I left in a debug WARN to yell if
the new check acutally fires.

Meanwhile, it stops the erroneous specialisation.

binding coercion
compiler/specialise/SpecConstr.hs
testsuite/tests/simplCore/should_compile/T14270a.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T