Skip to content

Treat member access of a constant record as a constant expression. #3476

Closed
@water-mizuu

Description

@water-mizuu

Since a record's type is known at compile time, and if a record is constant then all of its members are constant, then we should just be able to use a constant record's members as a constant as well in my opinion.

const dimensions = (width: 250, height: 750);
const child = SizedBox(width: dimensions.width, height: dimensions.height);

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestRequests to resolve a particular developer problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions