Skip to content

Commit 2e5e3bc

Browse files
authored
Fix debug assertion in ComprehensionScope.GetParentClosureTuple (#1149)
1 parent fe1541c commit 2e5e3bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Src/IronPython/Compiler/Ast/Comprehension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ internal override bool ExposesLocalVariable(PythonVariable variable) {
246246
}
247247

248248
internal override MSAst.Expression/*!*/ GetParentClosureTuple() {
249-
Debug.Assert(NeedsLocalContext);
249+
Debug.Assert(NeedsLocalContext || IsClosure);
250250
return MSAst.Expression.Call(null, typeof(PythonOps).GetMethod(nameof(PythonOps.GetClosureTupleFromContext)), Parent.LocalContext);
251251
}
252252

0 commit comments

Comments
 (0)