Skip to content

enable strictFunctionTypes in VS Code codebase #81574

Closed
@mjbvz

Description

@mjbvz

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

Metadata

Metadata

Assignees

Labels

debtCode quality issuesengineeringVS Code - Build / issue tracking / etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions