Fix for pattern vars in transforms

We'll need this when making rewrite rules for partially evaluating type
class dictionaries.
Merge pull request #1623 from edwinb/patvars

Fix for pattern vars in transforms