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

Fixed error message when no type arguments are given (issue #1396) #1397

Merged
merged 1 commit into from
Nov 7, 2016
Merged

Fixed error message when no type arguments are given (issue #1396) #1397

merged 1 commit into from
Nov 7, 2016

Conversation

Theodus
Copy link
Contributor

@Theodus Theodus commented Nov 6, 2016

This PR resolves #1396 by passing the funref ast node to reify_defaults so that it may be used in error reporting in the case that no type arguments are given.

@Theodus Theodus changed the title pass ast to reify_defaults Fix error message when no type arguments are given Nov 6, 2016
@jemc
Copy link
Member

jemc commented Nov 6, 2016

I would have taken a slightly different approach here.

That is, whenever an AST node is constructed, it is constructed from another one, meaning among other things that it will inherit the position information from the other one (the position information that is used to point to the error location if there is an error).

So in this case, somewhere in the code we are creating an empty TK_TYPEARGS node from the TK_TYPEPARAMS node if the TK_TYPEARGS node does not yet exist (because there are no type arguments). I would argue that we need to fix this bit of code to create the empty TK_TYPEARGS node from some other AST node instead (for example, the argument list AST node would probably be appropriate, so that the location caret (^) will point at the argument list parenthesis.

Let me know if you need any help tracking this down or figuring it out.

@Theodus
Copy link
Contributor Author

Theodus commented Nov 6, 2016

@jemc Thanks for the different approach, it turns out that this is a much simpler fix.

@jemc jemc changed the title Fix error message when no type arguments are given Fixed error message when no type arguments are given (issue #1396) Nov 7, 2016
@jemc jemc added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Nov 7, 2016
@jemc jemc merged commit a9c4280 into ponylang:master Nov 7, 2016
ponylang-main added a commit that referenced this pull request Nov 7, 2016
@jemc
Copy link
Member

jemc commented Nov 7, 2016

Thanks!

@Theodus Theodus deleted the issue-1396 branch January 2, 2017 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad error message when not enough type arguments in method call
2 participants