scala/scala — pull request #1327 by xeno-by (2012-09-17 21:39:04+00:00)
Title: SI-6287 fixes synthetic symbol clashes in toolbox

Apparently synthetic classes like $anonfun$1 have two properties:
1) Their names are generated using a counter unique to a compilation unit
2) After flatten they levitate to the nearest enclosing package

As a result if we use an empty package to wrap toolbox codegen,
then this package will soon be overflown by $anonfun$1 symbols, because:
1) New codegen session = new compilation unit = new counter which starts at 0
2) New codegen session = new anon funs that end up as children of empty package

Creating a freshly named package for each codegen session fixed the problem.
Now anonfuns from different sessions end up with different parents.