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

Fix the order of overloads #36570

Closed
wants to merge 1 commit into from
Closed

Conversation

falsandtru
Copy link
Contributor

Fixes #36225

@falsandtru
Copy link
Contributor Author

@RyanCavanaugh Since neither reduce nor reduceRight method doesn't directly relate to the errors, looks like the errors (which were not discovered by gulp runtests-parallel) are caused by a bug of the compiler. For instance, the following function should return Statement[] when nodes is MutableNodeArray<Statement>, but actually returns Node[]. This is strange.

    export function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;

Looks like the errors indicate a bug of the compiler. Can you take a look?

cc @ahejlsberg

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I don't think this PR will be ready until #36554 is complete and I suspect the changes that reduce ends up with will look quite different from this.

In the meantime can you open a separate bug for the compiler error?

@falsandtru
Copy link
Contributor Author

OK, I opened #36591.

@sandersn
Copy link
Member

This PR hasn't seen any activity for quite a while, so I'm going to close it to keep the number of open PRs manageable. I think we should continue the discussion at #36554 first.

@sandersn sandersn closed this Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Type inference with reduce functions
2 participants