Skip to content

[BUG] Basic initialization with enums doesn't work. #670

Closed
@leejy12

Description

@leejy12

Describe the bug
Commit: d43a1f6
Basic initialization with explicitly typed enums don't work.

To Reproduce

cpp2:

MyEnum: @enum type = {
    Foo;
    Bar;
}

main: () -> i32 = {
    x: MyEnum = MyEnum::Foo;
}

cpp1:

[[nodiscard]] auto main() -> cpp2::i32
{
    MyEnum x{MyEnum::Foo}; // Error!
}

The type of MyEnum::Foo is cpp2::strict_value<cpp2::i8, MyEnum, false> which can't be converted to MyEnum class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions