Skip to content

Commit

Permalink
Fixed block function names not being unique across files
Browse files Browse the repository at this point in the history
  • Loading branch information
charliesome committed Feb 12, 2011
1 parent e91bb5d commit 3661cdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Fructose/Transformer/Transformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Transformer : IronRuby.Compiler.Ast.Walker
ClassDefinition currentClass;
Transformations transformations = new Transformations();
int blockUniqueId = 0;
static string blockPrefix = Guid.NewGuid().ToString().Split('-').First();

public Transformer(SourceUnitTree AST)
{
Expand Down Expand Up @@ -56,7 +57,7 @@ public override void Exit(ClassDefinition node)
protected override void Walk(BlockDefinition node)
{
var statements = currentClass == null ? AST.Statements : currentClass.Body.Statements;
var methodname = "__lambda_" + ++blockUniqueId;
var methodname = "__lambda_" + blockPrefix + "_" + ++blockUniqueId;

LexicalScope scope = currentClass != null ? currentClass.DefinedScope
: /* HACK HACK HACK */
Expand Down

0 comments on commit 3661cdf

Please sign in to comment.