google / google/closure-compiler

Non-Nullable by default flag

Open
#641 13 comments 5 reactions 0 assignees View on GitHub
enhancement internal-issue-created triage-done Types
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Closure compiler should have a flag to enable non-nullable by default. Switching to non-nullable as a compiler default would break a ton of backwards compatibility, but the existing semantics are screwy and a flag would allow a correction.

As it stands these two statements are equivalent:

```
/** @type {function(number)} */
/** @type {function(?number)} */
```

The current system requires a ridiculous amount of `!` symbols to counteract this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.