Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Number type patterns handled incorrectly #21

Open
R-unic opened this issue Jan 4, 2025 · 0 comments
Open

Number type patterns handled incorrectly #21

R-unic opened this issue Jan 4, 2025 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@R-unic
Copy link
Collaborator

R-unic commented Jan 4, 2025

Given the below C# code, we should end up with two different cases. One if a is a uint, the other if a is an int. However the outputted Luau code only creates one case, CS.is(a, "number"). Number types should actually have a runtime check for their respective type instead of just number.

object a = 1;
switch (a)
{
    case uint:
        break;
    case int:
        break;
}
local a: any = 1
repeat
  if CS.is(a, "number") then
    break
  end
  if CS.is(a, "number") then
    break
  end
until true
return nil
@R-unic R-unic added bug Something isn't working help wanted Extra attention is needed labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant