Deal with phantom type variables in rules
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 29 Jul 2015 15:06:29 +0000 (16:06 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 30 Jul 2015 10:03:06 +0000 (11:03 +0100)
commit4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb
tree15af943ad5b3474ca7f03a07b4325684b5d39a74
parentfac11f853598c1decdf8d0facba5f25a6219f11f
Deal with phantom type variables in rules

See Note [Unbound template type variables] in Rules.hs
This fixes Trac #10689.

The problem was a rule LHS that mentioned a type variable
in a phantom argument to a type synonym.  Then matching the
LHS didn't bind the type variable, and the rule matcher
complained.

This patch fixes the problem, as described by the Note.

I also went back to not-cloning the template varaibles during
rule matching.  I'm convinced that it's not necessary now
(if it ever was), and cloning makes the fix for #10689 much more
fiddly.
compiler/specialise/Rules.hs
testsuite/tests/simplCore/should_compile/T10689.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T10689a.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T