Skip to content

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

@Omega359

Description

@Omega359

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions