New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable strict null checking for Notifications test #65291

Merged
merged 2 commits into from Dec 19, 2018

Conversation

Projects
None yet
4 participants
@usernamehw
Copy link
Contributor

usernamehw commented Dec 18, 2018

#65233

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

@mjbvz mjbvz added this to the December/January 2019 milestone Dec 19, 2018

@mjbvz mjbvz merged commit 85dcbf7 into Microsoft:master Dec 19, 2018

1 of 2 checks passed

VS Code #20181218.51 failed
Details
license/cla All CLA requirements met.
Details
@mjbvz

This comment has been minimized.

Copy link
Contributor

mjbvz commented Dec 19, 2018

Thanks!

@usernamehw usernamehw deleted the usernamehw:strict_null_notifications branch Dec 19, 2018

@@ -15,14 +15,14 @@ suite('Notifications', () => {

// 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! }));

This comment has been minimized.

@epicfaace

epicfaace Dec 19, 2018

Contributor

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

This comment has been minimized.

@usernamehw

usernamehw Dec 19, 2018

Author Contributor

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

This comment has been minimized.

@epicfaace

epicfaace Dec 19, 2018

Contributor

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.

This comment has been minimized.

@usernamehw

usernamehw Dec 19, 2018

Author Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment