Skip to content

Allow side-effect-free functions to be called at compile time (in constants) #29277

Closed as not planned
@Hixie

Description

@Hixie

I have a class in Flutter (Flow) that takes a List<Widget> and passes a new list to its superclass constructor, the new list consisting of the incoming list mapped in a well-defined manner (each entry is wrapped in an instance of another class). All the information is available to evaluate this entire operation at compile time, and being able to do it then would allow big performance wins (because it would allow us to build the entire widget subtree once as a constant, which would then be == to itself each time it was referenced and thus we could avoid doing any work rebuilding that part of the tree).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).closed-staleClosed as the issue or PR is assumed staletype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions