Skip to content

Commit 92470d8

Browse files
committed
Do not try to look above scope barriers in findLocalVarNode()
1 parent e1238f8 commit 92470d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/truffleruby/parser/TranslatorEnvironment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ public ReadLocalNode findLocalVarNode(String name, SourceIndexLength sourceSecti
136136
return node;
137137
}
138138

139+
if (current.neverAssignInParentScope) {
140+
// Do not try to look above scope barriers (def, module)
141+
return null;
142+
}
143+
139144
current = current.parent;
140145
level++;
141146
}

0 commit comments

Comments
 (0)