Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Switch range operators dont work even though they throw no compile errors #163

Open
Happyrobot33 opened this issue Apr 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Happyrobot33
Copy link

Happyrobot33 commented Apr 29, 2024

Using code like this

for (int i = 0; i < 100; i++)
{
    switch (i)
    {
        case int n when n < 50:
            Debug.Log("1");
            break;
        case int n when n < 100:
            Debug.Log("2");
            break;
    }
}

I would expect it to print 1 until it gets to 50, and then start printing 2. However, this always prints 1 no matter what, and also does not throw any compiler errors that range switch statements are unsupported

@Happyrobot33 Happyrobot33 added the bug Something isn't working label Apr 29, 2024
@Happyrobot33 Happyrobot33 changed the title Switch expressions dont work even though they throw no compile errors Switch ranger operators dont work even though they throw no compile errors Apr 29, 2024
@Happyrobot33 Happyrobot33 changed the title Switch ranger operators dont work even though they throw no compile errors Switch range operators dont work even though they throw no compile errors Apr 29, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant