Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Preceding an optional chain with a non-null assertion is useless.
The entire point of the optional chain is that it handles the non-null case.
The non-null assertion doesn't actually change the type, and is functionally useless.
functionfoo(x?:{a:string}){returnx!?.a;}
Thinking about it, this could potentially live as an option withinno-extra-non-null-assertion
, but I'm not sure if it entirely fits in there.