Skip to content

[BUG] Switch foreach case looses _forEachIndex #110

@X39

Description

@X39

Describe the bug
Using foreach around a switch containing the case clauses will cause the variable tree to loose the _forEachIndex variable.

To Reproduce
Steps to reproduce the behavior:

  1. Execute code below
  2. Check output

Expected behavior
2. Output should resemble _testarray

Additional context

private _testarray = [1, 2, 3, 4 ,5, 6];
private _a = 3;
switch (_a) do
{
    {
        case _x: { hint str (_testarray select (_forEachIndex + 1)) };
    } foreach _testarray
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugError, flaw, failure or fault that causes to produce an incorrect result or crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions