Skip to content

Generic functions with enum generic param #2187

@Jacques66

Description

@Jacques66

The following code doesn't compile: "The getter 'values' isn't defined for the type 'Type'."

T stuff<T extends Enum>(String s) { return T.values.firstWhere((e) => e.toString() == s); }

Probably not supported, so this is a request for someday ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    state-duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions