dart-lang / dart-lang/language

Are we thinking about an alias for if null and if not null?

Open
#2,332 10 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

request
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

Sorry if already posted, I just couldn't find anything related.

What about a shorthand to if (foo == null) and if (foo != null)?

Maybe some simple stuff like

if (foo?) // same as foo == null

if (foo!) // same as foo != null

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the proposed ? and ! aliases in the issue and reviewing the existing comment thread for prior discussion. Identify the language specification and implementation entry points affected by adding null-check syntax; done means reaching and documenting a settled design decision, including semantics and any required tests.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.