Skip to content

VS Code codebase compile errors with 3.9.0-dev.20200324 #37556

Closed
@mjbvz

Description

@mjbvz

TypeScript Version: 3.9.0-dev.20200324

Repro

  1. Try using 3.9.0-dev.20200324 to build VS Code

Problem
I see ~30 errors (after fixing a few simple ones). Many of these are related to awaited. I'll start splitting out individual issues when I can create small repos

[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/services/search/node/rawSearchService.ts(382,3): Type '(Anonymous class)' is not assignable to type 'CancelablePromise<C>'.
  Types of property 'then' are incompatible.
    Type '<TResult1 = C, TResult2 = never>(resolve?: ((value: C) => TResult1 | Promise<TResult1>) | null | undefined, reject?: ((reason: any) => TResult2 | Promise<TResult2>) | null | undefined) => Promise<...>' is not assignable to type '<TResult1 = C, TResult2 = never>(onfulfilled?: ((value: awaited C) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => Promise<...>'.
      Types of parameters 'resolve' and 'onfulfilled' are incompatible.
        Types of parameters 'value' and 'value' are incompatible.
          Type 'C' is not assignable to type 'awaited C'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/services/search/node/rawSearchService.ts(387,4): Property 'then' in type '(Anonymous class)' is not assignable to the same property in base type 'CancelablePromise<C>'.
  Type '<TResult1 = C, TResult2 = never>(resolve?: ((value: C) => TResult1 | Promise<TResult1>) | null | undefined, reject?: ((reason: any) => TResult2 | Promise<TResult2>) | null | undefined) => Promise<...>' is not assignable to type '<TResult1 = C, TResult2 = never>(onfulfilled?: ((value: awaited C) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => Promise<...>'.
    Types of parameters 'resolve' and 'onfulfilled' are incompatible.
      Types of parameters 'value' and 'value' are incompatible.
        Type 'C' is not assignable to type 'awaited C'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/services/search/node/rawSearchService.ts(388,25): Argument of type '((value: C) => TResult1 | Promise<TResult1>) | null | undefined' is not assignable to parameter of type '((value: awaited C) => TResult1 | awaited TResult1 | PromiseLike<TResult1 | awaited TResult1>) | null | undefined'.
  Type '(value: C) => TResult1 | Promise<TResult1>' is not assignable to type '(value: awaited C) => TResult1 | awaited TResult1 | PromiseLike<TResult1 | awaited TResult1>'.
    Types of parameters 'value' and 'value' are incompatible.
      Type 'awaited C' is not assignable to type 'C'.
        'C' could be instantiated with an arbitrary type which could be unrelated to 'awaited C'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/services/history/browser/history.ts(342,49): Argument of type '() => boolean' is not assignable to parameter of type '() => void | PromiseLike<void>'.
  Type 'boolean' is not assignable to type 'void | PromiseLike<void>'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/contrib/search/common/searchModel.ts(609,21): Type 'FileMatch | FileMatch[]' must have a '[Symbol.iterator]()' method that returns an iterator.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/base/browser/ui/list/listPaging.ts(58,53): Argument of type 'awaited TElement' is not assignable to parameter of type 'TElement'.
  'TElement' could be instantiated with an arbitrary type which could be unrelated to 'awaited TElement'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts(89,42): Type '{ [x: string]: any; }' must have a '[Symbol.iterator]()' method that returns an iterator.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/api/common/extHostTreeViews.ts(336,43): Argument of type 'awaited T' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/api/common/extHostTreeViews.ts(337,43): Argument of type 'awaited T' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/api/common/extHostCommands.ts(230,67): Argument of type '<R>(...args: any[]) => Promise<R>' is not assignable to parameter of type '<T>(...args: any[]) => T | Thenable<T>'.
  Type 'Promise<T>' is not assignable to type 'T | Thenable<T>'.
    Type 'Promise<T>' is not assignable to type 'Thenable<T>'.
      Types of property 'then' are incompatible.
        Type '<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => Promise<...>' is not assignable to type '{ <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<TResult>) | undefined, onrejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined): Thenable<...>; <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<...>) | undefined, onrejected?: ((reason: any) => void) | undefined): Thenable<...>; <T...'.
          Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
            Type '((value: T) => any) | undefined' is not assignable to type '((value: awaited T) => any) | null | undefined'.
              Type '(value: T) => any' is not assignable to type '(value: awaited T) => any'.
                Types of parameters 'value' and 'value' are incompatible.
                  Type 'awaited T' is not assignable to type 'T'.
                    'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/api/common/extHost.api.impl.ts(246,5): Type 'Promise<T>' is not assignable to type 'Thenable<T>'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/api/common/extHost.api.impl.ts(1076,3): Type 'Promise<awaited T>' is not assignable to type 'Thenable<T>'.
  Types of property 'then' are incompatible.
    Type '<TResult1 = awaited T, TResult2 = never>(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => Promise<...>' is not assignable to type '{ <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<TResult>) | undefined, onrejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined): Thenable<...>; <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<...>) | undefined, onrejected?: ((reason: any) => void) | undefined): Thenable<...>; <T...'.
      Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
        Type '((value: T) => any) | undefined' is not assignable to type '((value: awaited T) => any) | null | undefined'.
          Type '(value: T) => any' is not assignable to type '(value: awaited T) => any'.
            Types of parameters 'value' and 'value' are incompatible.
              Type 'awaited T' is not assignable to type 'T'.
                'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/editor/contrib/hover/hoverOperation.ts(104,39): Argument of type '(asyncResult: Result) => void' is not assignable to parameter of type '(value: awaited Result) => void | PromiseLike<void>'.
  Types of parameters 'asyncResult' and 'value' are incompatible.
    Type 'awaited Result' is not assignable to type 'Result'.
      'Result' could be instantiated with an arbitrary type which could be unrelated to 'awaited Result'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/base/common/async.ts(37,9): Conversion of type '(Anonymous class)' to type 'CancelablePromise<T>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property '[Symbol.toStringTag]' is missing in type '(Anonymous class)' but required in type 'CancelablePromise<T>'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/base/common/async.ts(42,24): Argument of type '((value: T) => TResult1 | Promise<TResult1>) | null | undefined' is not assignable to parameter of type '((value: awaited T) => TResult1 | awaited TResult1 | PromiseLike<TResult1 | awaited TResult1>) | null | undefined'.
  Type '(value: T) => TResult1 | Promise<TResult1>' is not assignable to type '(value: awaited T) => TResult1 | awaited TResult1 | PromiseLike<TResult1 | awaited TResult1>'.
    Types of parameters 'value' and 'value' are incompatible.
      Type 'awaited T' is not assignable to type 'T'.
        'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/base/common/async.ts(79,12): Argument of type 'T | Thenable<T>' is not assignable to parameter of type 'T | awaited T | PromiseLike<T> | undefined'.
  Type 'Thenable<T>' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
    Type 'Thenable<T>' is not assignable to type 'PromiseLike<T>'.
      Types of property 'then' are incompatible.
        Type '{ <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<TResult>) | undefined, onrejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined): Thenable<...>; <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<...>) | undefined, onrejected?: ((reason: any) => void) | undefined): Thenable<...>; <T...' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => PromiseLike<...>'.
          Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
            Type '((value: awaited T) => any) | null | undefined' is not assignable to type '((value: T) => any) | undefined'.
              Type 'null' is not assignable to type '((value: T) => any) | undefined'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/base/common/async.ts(403,19): Argument of type 'awaited T' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/base/common/async.ts(463,17): Argument of type '(value?: T | Promise<T> | undefined) => void' is not assignable to parameter of type '(value: awaited T) => void | PromiseLike<void>'.
  Types of parameters 'value' and 'value' are incompatible.
    Type 'awaited T' is not assignable to type 'T | Promise<T> | undefined'.
      Type 'awaited T' is not assignable to type 'Promise<T>'.
[14:16:40] Error: /Users/matb/projects/vscode/src/vs/workbench/workbench.web.api.ts(249,25): Type 'readonly ICommand[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/merge-conflict/src/delayer.ts(34,5): Type '(value?: T | awaited T | PromiseLike<T> | undefined) => void' is not assignable to type '(value?: T | Thenable<T> | undefined) => void'.
  Types of parameters 'value' and 'value' are incompatible.
    Type 'T | Thenable<T> | undefined' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
      Type 'Thenable<T>' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
        Type 'Thenable<T>' is not assignable to type 'PromiseLike<T>'.
          Types of property 'then' are incompatible.
            Type '{ <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<TResult>) | undefined, onrejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined): Thenable<...>; <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<...>) | undefined, onrejected?: ((reason: any) => void) | undefined): Thenable<...>; }' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => PromiseLike<...>'.
              Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
                Type '((value: awaited T) => any) | null | undefined' is not assignable to type '((value: T) => any) | undefined'.
                  Type 'null' is not assignable to type '((value: T) => any) | undefined'.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/github-authentication/src/common/utils.ts(64,3): Argument of type '(result: U) => U' is not assignable to parameter of type '(value: awaited U) => U | PromiseLike<U>'.
  Types of parameters 'result' and 'value' are incompatible.
    Type 'awaited U' is not assignable to type 'U'.
      'U' could be instantiated with an arbitrary type which could be unrelated to 'awaited U'.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/git/src/util.ts(390,17): Argument of type '(value?: T | Promise<T> | undefined) => void' is not assignable to parameter of type '(value: awaited T) => void | PromiseLike<void>'.
  Types of parameters 'value' and 'value' are incompatible.
    Type 'awaited T' is not assignable to type 'T | Promise<T> | undefined'.
      Type 'awaited T' is not assignable to type 'Promise<T>'.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/git/src/commands.ts(2567,3): Type '(awaited T)[]' is not assignable to type 'T[]'.
  Type 'awaited T' is not assignable to type 'T'.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/typescript-language-features/src/utils/async.ts(34,5): Type '(value?: T | awaited T | PromiseLike<T> | undefined) => void' is not assignable to type '(value?: T | Thenable<T> | undefined) => void'.
  Types of parameters 'value' and 'value' are incompatible.
    Type 'T | Thenable<T> | undefined' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
      Type 'Thenable<T>' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
        Type 'Thenable<T>' is not assignable to type 'PromiseLike<T>'.
          Types of property 'then' are incompatible.
            Type '{ <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<TResult>) | undefined, onrejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined): Thenable<...>; <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<...>) | undefined, onrejected?: ((reason: any) => void) | undefined): Thenable<...>; }' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => PromiseLike<...>'.
              Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
                Type '((value: awaited T) => any) | null | undefined' is not assignable to type '((value: T) => any) | undefined'.
                  Type 'null' is not assignable to type '((value: T) => any) | undefined'.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/php-language-features/src/features/utils/async.ts(69,29): Argument of type '(result: T) => void' is not assignable to parameter of type '(value: awaited T) => void | PromiseLike<void>'.
  Types of parameters 'result' and 'value' are incompatible.
    Type 'awaited T' is not assignable to type 'T'.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'awaited T'.
[14:16:40] Error: /Users/matb/projects/vscode/extensions/php-language-features/src/features/utils/async.ts(125,5): Type '(value?: T | awaited T | PromiseLike<T> | undefined) => void' is not assignable to type '(value: T | Thenable<T> | undefined) => void'.
  Types of parameters 'value' and 'value' are incompatible.
    Type 'T | Thenable<T> | undefined' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
      Type 'Thenable<T>' is not assignable to type 'T | awaited T | PromiseLike<T> | undefined'.
        Type 'Thenable<T>' is not assignable to type 'PromiseLike<T>'.
          Types of property 'then' are incompatible.
            Type '{ <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<TResult>) | undefined, onrejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined): Thenable<...>; <TResult>(onfulfilled?: ((value: T) => TResult | Thenable<...>) | undefined, onrejected?: ((reason: any) => void) | undefined): Thenable<...>; }' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: awaited T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => PromiseLike<...>'.
              Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
                Type '((value: awaited T) => any) | null | undefined' is not assignable to type '((value: T) => any) | undefined'.
                  Type 'null' is not assignable to type '((value: T) => any) | undefined'.

Metadata

Metadata

Assignees

No one assigned

    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