Skip to content
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

Experiment: Convert Promise<void> to Promise<undefined> #55096

Closed

Conversation

sandersn
Copy link
Member

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 20, 2023
@sandersn
Copy link
Member Author

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 20, 2023

Heya @sandersn, I've started to run the extended test suite on this PR at 8139c3c. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 20, 2023

Heya @sandersn, I've started to run the parallelized Definitely Typed test suite on this PR at 8139c3c. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 20, 2023

Heya @sandersn, I've started to run the diff-based user code test suite on this PR at 8139c3c. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 20, 2023

Heya @sandersn, I've started to run the diff-based top-repos suite on this PR at 8139c3c. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@sandersn Here are the results of running the user test suite comparing main and refs/pull/55096/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55096/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@typescript-bot
Copy link
Collaborator

@sandersn Here are the results of running the top-repos suite comparing main and refs/pull/55096/merge:

Something interesting changed - please have a look.

Details

angular/angular-cli

4 of 19 projects failed to build with the old tsc and were ignored

tests/legacy-cli/tsconfig.json

Eugeny/tabby

9 of 29 projects failed to build with the old tsc and were ignored

tabby-community-color-schemes/tsconfig.json

tabby-electron/tsconfig.json

tabby-linkifier/tsconfig.json

tabby-local/tsconfig.json

tabby-serial/tsconfig.json

tabby-ssh/tsconfig.json

tabby-telnet/tsconfig.json

tabby-terminal/tsconfig.json

tabby-terminal/tsconfig.typings.json

tabby-web-demo/tsconfig.json

microsoft/vscode

5 of 53 projects failed to build with the old tsc and were ignored

src/tsconfig.tsec.json

vuejs/core

1 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

@typescript-bot
Copy link
Collaborator

Hey @sandersn, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: chrome-apps
Error:

Error: Errors in typescript@local for external dependencies:
../../../../../../built/local/lib.dom.d.ts(6729,11): error TS2430: Interface 'Document' incorrectly extends interface 'NonElementParentNode'.
  The types returned by 'getElementById(...)' are incompatible between these types.
    Type 'HTMLElement | null' is not assignable to type 'Element | null'.
      Type 'HTMLElement' is not assignable to type 'Element'.
        The types returned by 'requestFullscreen(...)' are incompatible between these types.
          Type 'Promise<void>' is not assignable to type 'Promise<undefined>'.
            Type 'void' is not assignable to type 'undefined'.
../../../../../../built/local/lib.dom.d.ts(6756,40): error TS2344: Type 'HTMLAnchorElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(6868,39): error TS2344: Type 'HTMLEmbedElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(6881,38): error TS2344: Type 'HTMLFormElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(6907,39): error TS2344: Type 'HTMLImageElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(6939,38): error TS2344: Type 'HTMLAnchorElement | HTMLAreaElement' does not satisfy the constraint 'Element'.
  Type 'HTMLAnchorElement' is not assignable to type 'Element'.
../../../../../../built/local/lib.dom.d.ts(6972,40): error TS2344: Type 'HTMLEmbedElement' does not satisfy the constraint 'Element'.
../../../../../../built/local/lib.dom.d.ts(6996,40): error TS2344: Type 'HTMLScriptElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(7251,101): error TS2344: Type 'HTMLElementTagNameMap[K]' does not satisfy the constraint 'Element'.
  Type 'HTMLElement | HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | HTMLAnchorElement | ... 59 more ... | HTMLWebViewElement' is not assignable to type 'Element'.
    Type 'HTMLElement' is not assignable to type 'Element'.
../../../../../../built/local/lib.dom.d.ts(7255,111): error TS2344: Type 'HTMLElementDeprecatedTagNameMap[K]' does not satisfy the constraint 'Element'.
  Type 'HTMLElement | HTMLPreElement | HTMLUnknownElement | HTMLFontElement | HTMLDirectoryElement | HTMLFrameElement | HTMLFrameSetElement | HTMLMarqueeElement | HTMLParamElement' is not assignable to type 'Element'.
    Type 'HTMLElement' is not assignable to type 'Element'.
../../../../../../built/local/lib.dom.d.ts(7268,111): error TS2344: Type 'HTMLElement' does not satisfy the constraint 'Element'.
../../../../../../built/local/lib.dom.d.ts(7383,11): error TS2430: Interface 'DocumentFragment' incorrectly extends interface 'NonElementParentNode'.
  The types returned by 'getElementById(...)' are incompatible between these types.
    Type 'HTMLElement | null' is not assignable to type 'Element | null'.
../../../../../../built/local/lib.dom.d.ts(7729,101): error TS2344: Type 'HTMLElementTagNameMap[K]' does not satisfy the constraint 'Element'.
  Type 'HTMLElement | HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | HTMLAnchorElement | ... 59 more ... | HTMLWebViewElement' is not assignable to type 'Element'.
../../../../../../built/local/lib.dom.d.ts(7733,111): error TS2344: Type 'HTMLElementDeprecatedTagNameMap[K]' does not satisfy the constraint 'Element'.
  Type 'HTMLElement | HTMLPreElement | HTMLUnknownElement | HTMLFontElement | HTMLDirectoryElement | HTMLFrameElement | HTMLFrameSetElement | HTMLMarqueeElement | HTMLParamElement' is not assignable to type 'Element'.
../../../../../../built/local/lib.dom.d.ts(7736,111): error TS2344: Type 'HTMLElement' does not satisfy the constraint 'Element'.
../../../../../../built/local/lib.dom.d.ts(9927,40): error TS2344: Type 'HTMLOptionElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(10049,11): error TS2430: Interface 'HTMLElement' incorrectly extends interface 'Element'.
../../../../../../built/local/lib.dom.d.ts(11998,58): error TS2344: Type 'HTMLOptionElement' does not satisfy the constraint 'Element'.
../../../../../../built/local/lib.dom.d.ts(12384,48): error TS2344: Type 'HTMLOptionElement' does not satisfy the constraint 'Element'.
../../../../../../built/local/lib.dom.d.ts(12851,37): error TS2344: Type 'HTMLTableRowElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(12871,40): error TS2344: Type 'HTMLTableSectionElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(12990,38): error TS2344: Type 'HTMLTableCellElement' does not satisfy the constraint 'Element'.
  Types of property 'requestFullscreen' are incompatible.
    Type '() => Promise<void>' is not assignable to type '(options?: FullscreenOptions | undefined) => Promise<undefined>'.
../../../../../../built/local/lib.dom.d.ts(13076,37): error TS2344: Type 'HTMLTableRowElement' does not satisfy the constraint 'Element'.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: dexie-batch
Error:

Error: Errors in typescript@local for external dependencies:
node_modules/dexie/dist/dexie.d.ts(55,18): error TS2430: Interface 'PromiseExtendedConstructor' incorrectly extends interface 'PromiseConstructor'.
  Types of property 'resolve' are incompatible.
    Type '{ <T>(value: T | PromiseLike<T>): PromiseExtended<T>; (): PromiseExtended<void>; }' is not assignable to type '{ (): Promise<undefined>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>; }'.
      Target signature provides too few arguments. Expected 1 or more, but got 0.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: es-abstract
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/es-abstract/test/es5.test.ts:47:1
ERROR: 47:1  expect  TypeScript@local expected type to be:
  Promise<void>
got:
  Promise<undefined>

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: dom-mediacapture-transform
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/dom-mediacapture-transform/dom-mediacapture-transform-tests.ts:68:9
ERROR: 68:9   expect  TypeScript@local expected type to be:
  void
got:
  undefined
ERROR: 145:9  expect  TypeScript@local expected type to be:
  void
got:
  undefined

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: chillout
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/chillout/chillout-tests.ts:54:1
ERROR: 54:1   expect  TypeScript@local expected type to be:
  ChilloutIterator<Promise<void>, null>
got:
  ChilloutIterator<Promise<undefined>, null>
ERROR: 106:1  expect  TypeScript@local expected type to be:
  ChilloutIterator<Promise<void>, null>
got:
  ChilloutIterator<Promise<undefined>, null>
ERROR: 168:1  expect  TypeScript@local expected type to be:
  ChilloutIterator<Promise<void>, null>
got:
  ChilloutIterator<Promise<undefined>, null>
ERROR: 200:1  expect  TypeScript@local expected type to be:
  ChilloutIterator<Promise<void>, null>
got:
  ChilloutIterator<Promise<undefined>, null>
ERROR: 253:1  expect  TypeScript@local expected type to be:
  ChilloutIterator<Promise<void>, null>
got:
  ChilloutIterator<Promise<undefined>, null>

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: promise-debounce
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/promise-debounce/promise-debounce-tests.ts:4:1
ERROR: 4:1  expect  TypeScript@local expected type to be:
  () => Promise<void>
got:
  () => Promise<undefined>

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@sandersn sandersn closed this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants