Skip to content

Unions as parameters #3608

Open
Open
@mnordine

Description

@mnordine

I read https://github.com/dart-lang/language/blob/main/working/union-types/nominative-union-types.md, and see the proposed syntax is something like:

typedef UrlThingy = Url | String;
Future<Response> get(UrlThingy url) async {
  ...
}

Could we just do:

Future<Response> get(Url | String url) async {
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProposed language feature that solves one or more problems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions