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

Update to TypeScript 3.5.1 #2437

Merged
merged 1 commit into from
Jun 1, 2019
Merged

Update to TypeScript 3.5.1 #2437

merged 1 commit into from
Jun 1, 2019

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Jun 1, 2019

There were some minor changes because type analysis was more precise than previous versions and globalThis needed to be removed from the runtime type library, because it is provided by TypeScript itself.

const method: (...args: any[]) => any = searchParams[methodName];
searchParams[methodName] = (...args: unknown[]): void => {
searchParams[methodName] = (...args: unknown[]): any => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why any as you don't return a value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an assignability issue in 3.5.1. Now TypeScript goes through each of the methodName values on searchParams and looks at the assignability, and some of those return things, so you can't assign a void to them. I don't know if the code is actually wrong or not, but now TypeScript is doing some real valid analysis. It is possible this method should really be returning something, but I just made a fix to get the code to pass under 3.5.1.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@ry ry merged commit d438a6d into denoland:master Jun 1, 2019
@kitsonk kitsonk deleted the ts-35 branch June 4, 2019 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants