Skip to content

Fix return value and error reporting for getIterationTypesOfMethod #50146

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

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

rbuckton
Copy link
Contributor

@rbuckton rbuckton commented Aug 2, 2022

This fixes getIterationTypesOfMethod to correctly return undefined when the iterator type does not have a valid next method. This also ensures related errors are still reported when we've already cached a noIterationTypes result.

Related #49736

@gabritto
Copy link
Member

gabritto commented Aug 3, 2022

Thanks for fixing this, I think now the iterator/iterable functions will make more sense.

@rbuckton
Copy link
Contributor Author

rbuckton commented Aug 3, 2022

@typescript-bot test this
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 3, 2022

Heya @rbuckton, I've started to run the extended test suite on this PR at 51be560. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 3, 2022

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

Update: The results are in!

@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 diff here.

@typescript-bot
Copy link
Collaborator

@rbuckton
The results of the user tests run you requested are in!

Here they are:

Comparison Report - main..refs/pull/50146/merge

[adonis-framework]

1 of 1 projects failed to build with the old tsc

/mnt/ts_downloads/adonis-framework/tsconfig.json

  • error TS2322: Type 'Generator<any, any, unknown>' is not assignable to type 'boolean'.
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(77,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/Drivers/Cookie/index.js(88,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(59,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/Drivers/Redis/index.js(72,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/index.js(168,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/index.js(204,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/index.js(234,15)
    • /mnt/ts_downloads/adonis-framework/node_modules/adonis-framework/src/Session/index.js(287,15)

@rbuckton
Copy link
Contributor Author

rbuckton commented Aug 3, 2022

/mnt/ts_downloads/adonis-framework/tsconfig.json

  • error TS2322: Type 'Generator<any, any, unknown>' is not assignable to type 'boolean'.

Not actually a new error, this previously said error TS2322: Type 'Generator<any, any, any>' is not assignable to type 'boolean'., so the only difference is the type we show for the error message when checking if a return type is valid for a generator.

@rbuckton rbuckton force-pushed the fixGetIterationTypesOfMethod branch from 51be560 to 98507a1 Compare August 3, 2022 20:49
@rbuckton rbuckton merged commit 6bbe6d6 into main Aug 3, 2022
@rbuckton rbuckton deleted the fixGetIterationTypesOfMethod branch August 3, 2022 23:07
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.

3 participants