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

Improve inference for tuple types #11

Closed
wants to merge 2 commits into from

Conversation

graphemecluster
Copy link
Contributor

See this thread in your Twitter community.

But I think you shouldn't merge until microsoft/TypeScript#48663 is being solved or it will affect development experience, so I made this PR a draft.

@graphemecluster
Copy link
Contributor Author

I don't think TypeScript is going to solve microsoft/TypeScript#44309 in a short time due to compatibility issues. So maybe you can promote this library there afterwards w

@graphemecluster
Copy link
Contributor Author

Another approach that doesn't require microsoft/TypeScript#48663 to be solved is to replace all the occurrences of ...args: ValueIndexPair<this, T> by the ordinary way value: T, index: Indices<this>, array: this.

@graphemecluster
Copy link
Contributor Author

Unfortunately I don't know why the test failed (it also failed in my computer); the two types should be identical. And I didn't touch lib.es2017.object.d.ts either. Am I missing something…?

@graphemecluster
Copy link
Contributor Author

Lastly I would like to know the reason to repeat the utility types in both lib.es5.d.ts and lib.util.d.ts.

@graphemecluster
Copy link
Contributor Author

Regarding the test, I doubt T[] isn't the same as T[] | []. I will just keep the error here for the time being.

@graphemecluster
Copy link
Contributor Author

Close due to excessive changes.

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.

1 participant