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 check for ./vs/base/test/common/history.test.ts #65453

Merged
merged 1 commit into from Dec 20, 2018

Conversation

Projects
None yet
2 participants
@gangachris
Copy link
Contributor

gangachris commented Dec 20, 2018

#65233

  • "./vs/base/test/common/history.test.ts"

Not sure how to fix this. yarn strict-null-check

function toArray(historyNavigator: HistoryNavigator<string>): string[] {
let result: string[] = [];
historyNavigator.first();
if (historyNavigator.current()) {
do {
result.push(historyNavigator.current());
} while (historyNavigator.next());
}
return result;
}
});

result.push(historyNavigator.current());

result is defined as a type string[]
historyNavigator.current() is defined as type <T> | null, in this case string | null.

I'm thinking of changing the types for HistoryNavigator.<method> back to just return T and not T | null

Thoughts ?

@gangachris gangachris changed the title enable strict null check Enable strict null check for ./vs/base/test/common/history.test.ts Dec 20, 2018

@gangachris

This comment has been minimized.

Copy link
Contributor Author

gangachris commented Dec 20, 2018

Decided to change
string[] to Array<string | null>

@sandy081 sandy081 added this to the December/January 2019 milestone Dec 20, 2018

@sandy081 sandy081 self-requested a review Dec 20, 2018

@sandy081 sandy081 merged commit ce2987b into Microsoft:master Dec 20, 2018

2 checks passed

VS Code #20181220.34 succeeded
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment