Skip to content

Missing @nogc check for enum variable initialization #21052

@dkorpel

Description

@dkorpel

This @nogc function compiles, but allocates an array literal with the GC at runtime:

void f() @nogc
{
    enum DA : int[] { a = [1,2,3] }
    DA da;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions