lampepfl/scala-js — pull request #33 by lihaoyi (2013-11-08 07:19:08+00:00)
Title: Fix freshName bug

This fixes a bug where `x$1` generated by freshName conflicts with `x$1` generated by the pattern matcher. Instead of trying to keep counts, this simply tracks every freshName allocated ever and refuses to allocate a name more than once.

A while loop is probably less efficient than doing clever math, but I don't think the perf hit is going to cause anyone to notice.