Problem
For an example service defined in VS Code core:
export class MyService {
constructor(
private readonly value: string,
@ITextModelService private readonly textModelResolverService: ITextModelService
) { }
}
It is currently possible to use the instantiation service to create an instance of MyService that passes undefined for value:
instantiationService.createInstance(MyService, undefined);
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 base
There 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
Problem
For an example service defined in VS Code core:
It is currently possible to use the instantiation service to create an instance of
MyServicethat passesundefinedforvalue:This does not produce any compile errors. It does bypass our strict null checking however and can cause unexpected runtime behavior.
Proposed fix
Enable
strictFunctionTypesin 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