Skip to content

Consider type promotion rules for select #4764

Open
@dsharletg

Description

@dsharletg

Currently, select requires the second and third arguments to have a matching type.

It might make sense to allow some type promotion, e.g. select(condition, uint16_buf(x, y), uint8_buf(x, y)) would transparently cast the uint8 value to uint16.

One upside is it makes the language less pedantic/verbose in cases where casts are needed today. One downside is it may enable silent performance bugs that otherwise would have been caught. There may be other things to consider too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionFor talking about potential improvements & changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions