Skip to content

Enable strict null checking for Notifications test#65291

Merged
mjbvz merged 2 commits intomicrosoft:masterfrom
usernamehw:strict_null_notifications
Dec 19, 2018
Merged

Enable strict null checking for Notifications test#65291
mjbvz merged 2 commits intomicrosoft:masterfrom
usernamehw:strict_null_notifications

Conversation

@usernamehw
Copy link
Contributor

@usernamehw usernamehw commented Dec 18, 2018

#65233

  • "./vs/workbench/test/common/notifications.test.ts"

@bpasero bpasero assigned mjbvz and unassigned bpasero Dec 18, 2018
@mjbvz mjbvz added this to the December/January 2019 milestone Dec 19, 2018
@mjbvz mjbvz merged commit 85dcbf7 into microsoft:master Dec 19, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 19, 2018

Thanks!

@usernamehw usernamehw deleted the strict_null_notifications branch December 19, 2018 19:20
// 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! }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@usernamehw what does this mean? Are you asserting that null is not null?

Copy link
Contributor Author

@usernamehw usernamehw Dec 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes? Hint that type is not null. But the value is still null.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants