Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Better typings for Promise.resolve(), like #31117#33074

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rbuckton merged 4 commits intomicrosoft:mainfromjablko:patch-5
Aug 2, 2022

Conversation

@jablko
Copy link
Contributor

No description provided.

treblasft reacted with rocket emoji
@jablkojablkoforce-pushed thepatch-5 branch 2 times, most recently fromd5b8656 toed55bc5CompareAugust 30, 2019 16:38
@jablkojablkoforce-pushed thepatch-5 branch 2 times, most recently from3523d88 to8607e69CompareSeptember 25, 2019 23:32
@jablkojablkoforce-pushed thepatch-5 branch 4 times, most recently from4aee6f8 toe6f14d6CompareOctober 7, 2019 14:31
@jablkojablkoforce-pushed thepatch-5 branch 2 times, most recently from0b9b4e6 to51538c3CompareOctober 16, 2019 14:46
@jablkojablkoforce-pushed thepatch-5 branch 2 times, most recently froma65e8c7 toacd3105CompareOctober 19, 2019 18:33
@jablkojablkoforce-pushed thepatch-5 branch 2 times, most recently from6a7c26e tob68a1baCompareNovember 16, 2019 15:24
@jablkojablko mentioned this pull requestNov 18, 2019
@jablkojablkoforce-pushed thepatch-5 branch 5 times, most recently fromab032d7 to3222ba5CompareNovember 28, 2019 14:51
@sandersn
Copy link
Member

@rbuckton Is this ready to merge now?

@rbuckton
Copy link
Contributor

I'd like to run the RWC and user tests once more to be sure.

@rbuckton
Copy link
Contributor

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

@typescript-bot
Copy link
Collaborator

typescript-bot commentedAug 1, 2022
edited
Loading

Heya@rbuckton, I've started to run the diff-based user code test suite on this PR at915863f. You can monitor the buildhere.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commentedAug 1, 2022
edited
Loading

Heya@rbuckton, I've started to run the parallelized Definitely Typed test suite on this PR at915863f. You can monitor the buildhere.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedAug 1, 2022
edited
Loading

Heya@rbuckton, I've started to run the extended test suite on this PR at915863f. You can monitor the buildhere.

@typescript-bot
Copy link
Collaborator

Heya@rbuckton, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diffhere.

@typescript-bot
Copy link
Collaborator

@rbuckton
Great news! no new errors were found between main..refs/pull/33074/merge

@rbuckton
Copy link
Contributor

rbuckton commentedAug 2, 2022
edited
Loading

This still causes a build break in older versions of firebase-sdk, but since this only occurs in an outdated snapshot of firebase in our RWC tests and not in the most recent version of firebase, this change seems acceptable.

    /**     * Takes an array of values and sequences them using the promise (or value)     * returned by the supplied callback. The callback for each item is called     * after the promise is resolved for the previous item.     * The function returns a promise which is resolved after the promise for     * the last item is resolved.     */    export function sequence<T, R>(      values: T[],      fn: (value: T, result?: R) => R | Promise<R>,      initialValue?: R    ): Promise<R> {      let result = Promise.resolve(initialValue);      values.forEach(value => {        result = result.then(lastResult => fn(value, lastResult));        ~~~~~~!!! error TS2322: Type 'Promise<R | Awaited<R>>' is not assignable to type 'Promise<Awaited<R>>'.!!! error TS2322:   Type 'R | Awaited<R>' is not assignable to type 'Awaited<R>'.!!! error TS2322:     Type 'R' is not assignable to type 'Awaited<R>'.      });      return result as AnyDuringMigration;    }

@rbucktonrbuckton merged commit040c121 intomicrosoft:mainAug 2, 2022
@sandersn
Copy link
Member

sandersn commentedAug 3, 2022
edited
Loading

Note that this breaks@types/react-test-renderer's attempt to create a type thatcan't be passed to Promise.resolve:

declareconstUNDEFINED_VOID_ONLY:unique symbol;exportfunctionact(callback:()=>void|{[UNDEFINED_VOID_ONLY]:never}):DebugPromiseLike;// Intentionally doesn't extend PromiseLike<never>.// Ideally this should be as hard to accidentally use as possible.exportinterfaceDebugPromiseLike{// the actual then() in here is 1-ary, but that doesn't count as a PromiseLike.then(onfulfilled:(value:never)=>never,onrejected:(reason:never)=>never):never;}//@ts-expect-error <-- this is no longer an errorPromise.resolve(act(()=>{}));

I think this change is still OK, I just wanted to report on the break.

@sandersn
Copy link
Member

This breaks vscode in a few places too, so we're going to revert it for 4.8 to give us a chance to figure out what to do.

sandersn added a commit that referenced this pull requestAug 8, 2022
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull requestAug 9, 2022
Component commits:c28ee65 Revert "Better typings for Promise.resolve(), likemicrosoft#31117 (microsoft#33074)"This reverts commit040c121.
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull requestAug 11, 2022
Component commits:c28ee65 Revert "Better typings for Promise.resolve(), likemicrosoft#31117 (microsoft#33074)"This reverts commit040c121.Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
This was referencedDec 9, 2022
@microsoftmicrosoft locked asresolvedand limited conversation to collaboratorsOct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@ExE-BossExE-BossExE-Boss approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@rbucktonrbuckton

Labels

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@jablko@typescript-bot@rbuckton@sandersn@ExE-Boss

[8]ページ先頭

©2009-2025 Movatter.jp