dart-lang / dart-lang/language
In type conversion, Dart lacks "as?" and "as!"
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
Just like Swift, it is very convenient under type conversion.
Compared with Swift, Dart's "as" is completely insufficient.
Now I urgently need "as?" and "as!" syntax support, because it can save me a lot of time and more possibilities. We no longer need to worry about a type conversion.
if (foo as? SliverBar) // then foo is promoted type SliverBar or null if not,And will not throw an error
foo may be "null" or any type.
Contributor guide
Research direction
No source file, test, or entry point is named. Start by reviewing the proposed Dart syntax and its comparison with Swift, then determine the required type-promotion and null/error semantics. Done means the language specification defines the feature and its behavior consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, swift
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100