Fix name-capture bug in rule matching
authorsimonpj@microsoft.com <unknown>
Fri, 24 Nov 2006 11:11:58 +0000 (11:11 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 24 Nov 2006 11:11:58 +0000 (11:11 +0000)
commitdfcbc18e016540cb136ec3298a07a4a55b488db0
treedef703d577bdbdfabed55c2e517cb26d95906c23
parent9ba6b0315f3719a2e8b85b78f84d0b5601490739
Fix name-capture bug in rule matching

The matching algorithm for RULES should respect alpha-conversion, but it
wasn't doing so.  In particular, if the names of the template variables
clashed with a variable in scope at the call site, bad things could happen
(it showed up as a CoreLint failure when compiling nofib/real/parser)

This patch fixes the problem; see Note [Template binders]

Test is in simplCore/should_compile/spec002, but nofib -O2 in
real/parser, real/fulsom
compiler/specialise/Rules.lhs