-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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 strictFunctionTypes in VS Code codebase #81574
Comments
This comment has been minimized.
This comment has been minimized.
As part of the fix for #81574, I discovered that a large number of callers were already passing `undefined` for this value. This fix just marks the type as possibly undefined as well
For #81574 `IInstantiationService.createInstance` currently does not do a good job at making sure you don't pass `undefined` as a parameter (see #81574) This change attempt to fix that by making the typings more explicit. The fix in turn revealed a lot of places where possible type errors were slipping through
For #81574 `IInstantiationService.createInstance` currently does not do a good job at making sure you don't pass `undefined` as a parameter (see #81574) This change attempt to fix that by making the typings more explicit. The fix in turn revealed a lot of places where possible type errors were slipping through
For #81574 `IInstantiationService.createInstance` currently does not do a good job at making sure you don't pass `undefined` as a parameter (see #81574) This change attempt to fix that by making the typings more explicit. The fix in turn revealed a lot of places where possible type errors were slipping through
For #81574 `IInstantiationService.createInstance` currently does not do a good job at making sure you don't pass `undefined` as a parameter (see #81574) This change attempt to fix that by making the typings more explicit. The fix in turn revealed a lot of places where possible type errors were slipping through
For #81574 Let TS infer the types for us here
Pushed a bunch of fixes. We're down to 23 errors. |
Down to 9 errors - This is some left for @bpasero in |
I don't understand the preferences editor one. It's on a line using the like it thinks a |
@roblourens I can't decipher this either but have added a workaround: 91fc43d |
@mjbvz Fixed the last ones, back to you. |
Problem
For an example service defined in VS Code core:
It is currently possible to use the instantiation service to create an instance of
MyService
that passesundefined
forvalue
:This does not produce any compile errors. It does bypass our strict null checking however and can cause unexpected runtime behavior.
Proposed fix
Enable
strictFunctionTypes
in our code baseThere are about 800 or so errors related to this in our code base today. While some of these errors are simple, many are rather cryptic and some may prove difficult to fix
The text was updated successfully, but these errors were encountered: