Skip to content

TypeScript 3.5 compile errors in the VS Code codebase #31380

Closed
@mjbvz

Description

@mjbvz

TypeScript Version: 3.5.0-dev.20190512

Repo
Build VS Code with TypeScript@next:

git clone https://github.com/microsoft/vscode.git
cd vscode
yarn add typescript@next
yarn run watch

Potential issues
There are 68 compile errors on TS@next, compared to zero when compiling with [email protected]:

[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/editor/editorWalkThrough.ts(53,9): Property 'deserialize' in type 'EditorWalkThroughInputFactory' is not assignable to the same property in base type 'IEditorInputFactory'.
  Type '(instantiationService: IInstantiationService, serializedEditorInput: string) => WalkThroughInput' is not assignable to type '(instantiationService: IInstantiationService, serializedEditorInput: string) => EditorInput | undefined'.
    Type 'WalkThroughInput' is not assignable to type 'EditorInput'.
      Types of property 'getTelemetryDescriptor' are incompatible.
        Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
          Type 'object' is not assignable to type '{ [key: string]: unknown; }'.
            Index signature is missing in type '{}'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/common/walkThroughInput.ts(83,2): Property 'getTelemetryDescriptor' in type 'WalkThroughInput' is not assignable to the same property in base type 'EditorInput'.
  Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
    Type 'object' is not assignable to type '{ [key: string]: unknown; }'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(254,2): Property 'setInput' in type 'WalkThroughPart' is not assignable to the same property in base type 'BaseEditor'.
  Type '(input: WalkThroughInput, options: EditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
    Types of parameters 'input' and 'input' are incompatible.
      Type 'EditorInput' is missing the following properties from type 'WalkThroughInput': disposables, promise, maxTopScroll, maxBottomScroll, and 5 more.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(262,25): Argument of type 'WalkThroughInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(266,10): Parameter 'model' implicitly has an 'any' type.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(298,29): Parameter 'snippet' implicitly has an 'any' type.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(298,38): Parameter 'i' implicitly has an 'any' type.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(481,51): Argument of type 'WalkThroughInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts(492,65): Argument of type 'WalkThroughInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution.ts(24,3): Argument of type 'typeof WalkThroughPart' is not assignable to parameter of type 'IConstructorSignature0<BaseEditor>'.
  Type 'WalkThroughPart' is not assignable to type 'BaseEditor'.
    Types of property 'setInput' are incompatible.
      Type '(input: WalkThroughInput, options: EditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
        Types of parameters 'input' and 'input' are incompatible.
          Type 'EditorInput' is not assignable to type 'WalkThroughInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution.ts(35,147): Argument of type 'typeof EditorWalkThroughInputFactory' is not assignable to parameter of type 'IConstructorSignature0<IEditorInputFactory>'.
  Type 'EditorWalkThroughInputFactory' is not assignable to type 'IEditorInputFactory'.
    Types of property 'deserialize' are incompatible.
      Type '(instantiationService: IInstantiationService, serializedEditorInput: string) => WalkThroughInput' is not assignable to type '(instantiationService: IInstantiationService, serializedEditorInput: string) => EditorInput | undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts(610,9): Property 'deserialize' in type 'WelcomeInputFactory' is not assignable to the same property in base type 'IEditorInputFactory'.
  Type '(instantiationService: IInstantiationService, serializedEditorInput: string) => WalkThroughInput' is not assignable to type '(instantiationService: IInstantiationService, serializedEditorInput: string) => EditorInput | undefined'.
    Type 'WalkThroughInput' is not assignable to type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts(45,132): Argument of type 'typeof WelcomeInputFactory' is not assignable to parameter of type 'IConstructorSignature0<IEditorInputFactory>'.
  Type 'WelcomeInputFactory' is not assignable to type 'IEditorInputFactory'.
    Types of property 'deserialize' are incompatible.
      Type '(instantiationService: IInstantiationService, serializedEditorInput: string) => WalkThroughInput' is not assignable to type '(instantiationService: IInstantiationService, serializedEditorInput: string) => EditorInput | undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/services/themes/common/fileIconThemeData.ts(121,7): Type 'any' is not assignable to type 'never'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/services/themes/common/colorThemeData.ts(254,7): Type 'any' is not assignable to type 'never'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.ts(213,17): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/services/extensions/node/extensionPoints.ts(292,16): Property 'hasOwnProperty' does not exist on type 'T'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/services/editor/browser/editorService.ts(510,4): Type 'SideBySideEditorInput' is not assignable to type 'EditorInput'.
  Types of property 'getTelemetryDescriptor' are incompatible.
    Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
      Type 'object' is not assignable to type '{ [key: string]: unknown; }'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/services/editor/browser/editorService.ts(525,4): Type 'DiffEditorInput' is not assignable to type 'EditorInput'.
  Types of property 'getTelemetryDescriptor' are incompatible.
    Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/test/common/editor/editorGroups.test.ts(213,31): Argument of type 'DiffEditorInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/test/common/editor/editorGroups.test.ts(214,31): Argument of type 'DiffEditorInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.ts(268,4): Type 'string' is not assignable to type 'undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.ts(280,5): Type 'string' is not assignable to type 'undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.ts(899,5): Type 'number' is not assignable to type 'undefined & RegExp'.
  Type 'number' is not assignable to type 'undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/search/browser/searchView.ts(647,66): Argument of type 'ITreeContextMenuEvent<FileMatch | Match | BaseFolderMatch | FolderMatch | null>' is not assignable to parameter of type 'ITreeContextMenuEvent<RenderableMatch>'.
  Type 'FileMatch | Match | BaseFolderMatch | FolderMatch | null' is not assignable to type 'RenderableMatch'.
    Type 'null' is not assignable to type 'RenderableMatch'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts(49,3): Argument of type 'typeof PreferencesEditor' is not assignable to parameter of type 'IConstructorSignature0<BaseEditor>'.
  Type 'PreferencesEditor' is not assignable to type 'BaseEditor'.
    Types of property 'setInput' are incompatible.
      Type '(newInput: PreferencesEditorInput, options: SettingsEditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
        Types of parameters 'newInput' and 'input' are incompatible.
          Type 'EditorInput' is missing the following properties from type 'PreferencesEditorInput': name, description, _details, _master, and 3 more.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts(134,5): Type 'PreferencesEditorInput' is not assignable to type 'EditorInput'.
  Types of property 'getTelemetryDescriptor' are incompatible.
    Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts(157,2): Property 'setInput' in type 'PreferencesEditor' is not assignable to the same property in base type 'BaseEditor'.
  Type '(newInput: PreferencesEditorInput, options: SettingsEditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
    Types of parameters 'newInput' and 'input' are incompatible.
      Type 'EditorInput' is not assignable to type 'PreferencesEditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts(164,25): Argument of type 'PreferencesEditorInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/output/browser/outputPanel.ts(100,8): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/output/browser/outputPanel.ts(103,29): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/output/browser/outputPanel.ts(104,24): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts(975,83): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts(975,121): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/experiments/node/experimentService.ts(181,36): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/experiments/node/experimentService.ts(181,61): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/debug/electron-browser/debugService.ts(746,8): Argument of type 'unknown' is not assignable to parameter of type 'ITaskSummary | Thenable<ITaskSummary | null> | null | undefined'.
  Type 'unknown' is not assignable to type 'Thenable<ITaskSummary | null>'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.ts(222,4): Type 'string | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.ts(164,48): Argument of type 'string | null' is not assignable to parameter of type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts(713,4): Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts(714,4): Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts(715,4): Type 'string | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts(716,4): Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts(853,3): Type 'string | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(96,2): Property 'setInput' in type 'SideBySideEditor' is not assignable to the same property in base type 'BaseEditor'.
  Type '(newInput: SideBySideEditorInput, options: EditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
    Types of parameters 'newInput' and 'input' are incompatible.
      Type 'EditorInput' is missing the following properties from type 'SideBySideEditorInput': name, description, _details, _master, and 3 more.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts(98,25): Argument of type 'SideBySideEditorInput' is not assignable to parameter of type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editorStatus.ts(1022,48): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.ts(91,3): Type 'string | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.ts(92,3): Type '"-2px" | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.ts(93,3): Type '"dashed" | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.ts(94,3): Type '"2px" | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.ts(84,3): Argument of type 'typeof BinaryResourceDiffEditor' is not assignable to parameter of type 'IConstructorSignature0<BaseEditor>'.
  Type 'BinaryResourceDiffEditor' is not assignable to type 'BaseEditor'.
    Types of property 'setInput' are incompatible.
      Type '(newInput: SideBySideEditorInput, options: EditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
        Types of parameters 'newInput' and 'input' are incompatible.
          Type 'EditorInput' is not assignable to type 'SideBySideEditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.ts(95,3): Argument of type 'typeof SideBySideEditor' is not assignable to parameter of type 'IConstructorSignature0<BaseEditor>'.
  Type 'SideBySideEditor' is not assignable to type 'BaseEditor'.
    Types of property 'setInput' are incompatible.
      Type '(newInput: SideBySideEditorInput, options: EditorOptions, token: CancellationToken) => Promise<void>' is not assignable to type '(input: EditorInput, options: EditorOptions | null, token: CancellationToken) => Promise<void>'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.ts(148,52): Types of property 'language' are incompatible.
  Type 'string | null' is not assignable to type 'string | undefined'.
    Type 'null' is not assignable to type 'string | undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.ts(209,5): Type 'SideBySideEditorInput' is not assignable to type 'EditorInput'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts(391,10): Conversion of type 'WorkbenchAsyncDataTree<URI | IWorkspace | IWorkspaceFolder | IFileStat, URI | IWorkspace | IWorkspaceFolder | IFileStat, [number, number, number]>' to type 'WorkbenchAsyncDataTree<BreadcrumbElement, any, [number, number, number]>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Type 'URI | IWorkspace | IWorkspaceFolder | IFileStat' is not comparable to type 'BreadcrumbElement'.
    Type 'IFileStat' is not comparable to type 'BreadcrumbElement'.
      Type 'IFileStat' is missing the following properties from type 'OutlineElement': marker, id, parent, symbol, and 2 more.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts(211,3): Type '"border-box" | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts(399,4): Type 'string | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/platform/instantiation/common/instantiationService.ts(226,13): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/platform/instantiation/common/instantiationService.ts(229,6): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/editor/contrib/colorPicker/colorDetector.ts(81,26): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/base/test/node/config.test.ts(27,28): Argument of type 'unknown' is not assignable to parameter of type 'object'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/common/editor.ts(569,2): Property 'getTelemetryDescriptor' in type 'SideBySideEditorInput' is not assignable to the same property in base type 'EditorInput'.
  Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
    Type 'object' is not assignable to type '{ [key: string]: unknown; }'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/workbench/browser/dnd.ts(84,22): Types of property 'viewState' are incompatible.
  Type 'ICodeEditorViewState | IDiffEditorViewState | null' is not assignable to type 'ICodeEditorViewState | IDiffEditorViewState | undefined'.
    Type 'null' is not assignable to type 'ICodeEditorViewState | IDiffEditorViewState | undefined'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/base/common/parsers.ts(83,15): Argument of type 'T' is not assignable to parameter of type 'object'.
[15:39:42] Error: /Users/matb/projects/vscode/src/vs/base/common/objects.ts(17,14): Argument of type 'T' is not assignable to parameter of type 'object'.
[15:39:42] Error: /Users/matb/projects/vscode/extensions/typescript-language-features/src/utils/surveyor.ts(107,27): Object is of type 'unknown'.
[15:39:42] Error: /Users/matb/projects/vscode/extensions/typescript-language-features/src/utils/surveyor.ts(107,41): Object is of type 'unknown'.

Some of these seem related to #30637 but other ones seem suspect (or should be noted in the breaking changes)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions