Skip to content

Commit

Permalink
[ruby] Fix Duplicate self References (#4902)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBakerEffendi authored Sep 6, 2024
1 parent daef3c5 commit d80fb41
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th
private def transformAsClosureBody(refs: List[Ast], baseStmtBlockAst: Ast) = {
// Determine which locals are captured
val capturedLocalNodes = baseStmtBlockAst.nodes
.collect { case x: NewIdentifier => x }
.collect { case x: NewIdentifier if x.name != Defines.Self => x } // Self identifiers are handled separately
.distinctBy(_.name)
.map(i => scope.lookupVariableInOuterScope(i.name))
.filter(_.nonEmpty)
Expand Down

0 comments on commit d80fb41

Please sign in to comment.