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

type coercion for arthmetic/binary ops fails for some unsigned/signed mappings #15340

Open
Omega359 opened this issue Mar 20, 2025 · 1 comment · May be fixed by #15341
Open

type coercion for arthmetic/binary ops fails for some unsigned/signed mappings #15340

Omega359 opened this issue Mar 20, 2025 · 1 comment · May be fixed by #15341
Assignees
Labels
bug Something isn't working

Comments

@Omega359
Copy link
Contributor

Omega359 commented Mar 20, 2025

Describe the bug

The type coercion in the mathematics_numerical_coercion function are too simple and do not properly handle mappings. However, the binary_numeric_coercion function does have the correct coercion rules for numeric values.

To Reproduce

You can see this with the tests:

test_coercion_binary_rule!(
            DataType::Int32,
            DataType::UInt32,
            Operator::Plus,
            DataType::Int32
        );

That is incorrect. Proper expansion of i32 and u32 is i64, not i32.

Expected behavior

Proper numeric type conversion happens when unsigned numeric types are involved.

Additional context

No response

@Omega359 Omega359 added the bug Something isn't working label Mar 20, 2025
@Omega359
Copy link
Contributor Author

take

@Omega359 Omega359 linked a pull request Mar 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant