Enable strict null checking for Notifications test#65291
Enable strict null checking for Notifications test#65291mjbvz merged 2 commits intomicrosoft:masterfrom usernamehw:strict_null_notifications
Conversation
|
Thanks! |
| // Invalid | ||
| assert.ok(!NotificationViewItem.create({ severity: Severity.Error, message: '' })); | ||
| assert.ok(!NotificationViewItem.create({ severity: Severity.Error, message: null })); | ||
| assert.ok(!NotificationViewItem.create({ severity: Severity.Error, message: null! })); |
There was a problem hiding this comment.
@usernamehw what does this mean? Are you asserting that null is not null?
There was a problem hiding this comment.
Yes? Hint that type is not null. But the value is still null.
There was a problem hiding this comment.
Specifically, what does null! mean? I thought that would mean to the compiler that null cannot be null, which doesn't make sense to me.
There was a problem hiding this comment.
I learned it yesterday myself. Yes, that's exactly what it means.
Those tests are bound to be failed. null is strict checked and cannot be passed as message, but there is a need to have a failing tests without thousands of compile errors in project. (And preferably by not casting everything to any to not loose autocomplete).
#65233
"./vs/workbench/test/common/notifications.test.ts"