Skip to content

Optimize native array initialization #5

@bamboo

Description

@bamboo

Currently the code:

var foo: int[] = [1, 2, 3];

expands to:

var foo: int[] = new Array(new Object[] { 1, 2, 3 }).ToBuiltin(int) cast int[];

The compiler should detect the pattern and remove the array creation altogether.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions