Skip to content

Commit 7b6e9c0

Browse files
fix foreach variable assignment
1 parent 1861d10 commit 7b6e9c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Code/ContextSystem/Contexts/Control/Loops/ForeachLoopContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public Result SetOptionalVariables(params VariableToken[] variableTokens)
9696

9797
_itemIterationVariableToken = itemToken;
9898

99-
if (variableTokens.LastOrDefault() is not {} indexToken) return true;
99+
if (variableTokens.LastOrDefault() is not {} indexToken || indexToken == itemToken) return true;
100100

101101
if (!indexToken.ValueType.IsAssignableFrom(typeof(NumberValue)))
102102
{

0 commit comments

Comments
 (0)