Skip to content

regression: error: @bitCast must have a known result type #217

@GalaxyShard

Description

@GalaxyShard

Repro:

#define BIT(n) (1u << (n))
#define BIT31 BIT(31)

unsigned int bit31() {
    return BIT31;
}

Translates to:

pub export fn bit31() c_uint {
    return @as(c_uint, 1) << @intCast(@bitCast(@as(c_int, @as(c_int, 31))));
}

Note the nested bitCast in an intCast.

Metadata

Metadata

Assignees

No one assigned

    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