dart-lang / dart-lang/language
Further extending the meaning of `?` to check for nulls
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
Currently, `?` can be used to mean "if not null". For example:
```
// If user is not null, do something
user?.doSomething(123);
```
Which is equivalent to:
```
// If user is not null, do something
if (user != null) user.doSomething(123);
```
I propose to extend this a little bit. Instead of:
```
// If user is not null, and name is not null, do something
if (user != null && name != null) doSomething();
```
I'd like to write:
```
// If user is not null, and name is not null, do something
if (user? && name?) doSomething();
```
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by reviewing the existing null-aware `?` behavior and the proposed examples; done means deciding and documenting the syntax and semantics of `if (user? && name?)`.
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