dart-lang / dart-lang/language
Unions as parameters
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
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:
```dart
typedef UrlThingy = Url | String;
Future get(UrlThingy url) async {
...
}
```
Could we just do:
```dart
Future get(Url | String url) async {
...
}
```
Contributor guide
Research direction
Start by reading working/union-types/nominative-union-types.md, which describes the proposed union syntax. Compare the typedef form there with the inline parameter form requested in this issue, then determine whether the language specification should support that syntax and what examples or tests would be needed to establish the decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100