question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong warning : ng8102

See original GitHub issue

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

Yes

Description

Wrong warning in this case

Exemple : warning NG8102: The left side of this nullish coalescing operation does not include ‘null’ or ‘undefined’ in its type, therefore the ‘??’ operator can be safely removed.

{{element.CurrentLock?.Clinician?.Label ?? '--'}}

In this case CurrentLock and Clinician could be null

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 13.2.0
Node: 14.18.3
Package Manager: npm 6.14.15
OS: win32 x64

Angular: 13.2.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, localize, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1302.0
@angular-devkit/build-angular   13.2.0
@angular-devkit/core            13.2.0
@angular-devkit/schematics      13.2.0
@schematics/angular             13.2.0
rxjs                            6.6.7
typescript                      4.5.4

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
JoostKcommented, Feb 2, 2022

13.2.1 is out which should have improved things. I’ll keep this open for a while, please report situations where you believe the rule is incorrect below.

3reactions
JoostKcommented, Jan 27, 2022

I will have a look at this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extended Diagnostics - Angular
Extended diagnostics are warnings by default and do not block compilation. ... The compiler emits the diagnostic as an error and fails the...
Read more >
What's new in Angular 13.2? - Ninja Squad
The second check logs a warning (code NG8102) if you use the nullish coalescing operator ?? on an expression that can not be...
Read more >
Solution-wide analysis | JetBrains Rider Documentation
When warnings are disabled, the status bar indicator will turn green as soon as the last error is fixed. Themed icon ignore errors...
Read more >
Angular Extended Diagnostics
... cause a compilation error and meet all syntax requirements), ... so by default detected anomalies are returned as warnings (this can be ......
Read more >
NGK® 8102 Spark Plug Wire - Set of 4 - CarParts.com
Warning Symbol WARNING: This product can expose you to chemical which is known to the State of California to cause cancer and birth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found