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

Parameter default value builds wrong parse tree #1705

Closed
ghost opened this issue Jun 5, 2016 · 0 comments
Closed

Parameter default value builds wrong parse tree #1705

ghost opened this issue Jun 5, 2016 · 0 comments
Assignees
Labels
antlr Issue is easier to resolve with knowledge of Antlr4 bug Identifies work items for known bugs
Milestone

Comments

@ghost
Copy link

ghost commented Jun 5, 2016

The default value in this example is treated as part of the "as type clause", which is wrong and probably because of the expression rule in complexType. One way to solve this could be to introduce a new typeExpression and copy over only the expression parts (e.g. without EQ) that are allowed in type expressions. That could also simplify the new / typeofis expression rules. We would have to deal with duplicate expression context classes though.

Public Sub Test(ByVal a As Integer, Optional foo As Object = Nothing)
End Sub

Edit: The create-declaration method in the declarationssymbollistener + the type annotation pass would have to be changed at least.

@ghost ghost added bug Identifies work items for known bugs antlr Issue is easier to resolve with knowledge of Antlr4 labels Jun 5, 2016
@Hosch250 Hosch250 self-assigned this Jun 21, 2016
@Hosch250 Hosch250 modified the milestones: Future Versions, Version 2.0 Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antlr Issue is easier to resolve with knowledge of Antlr4 bug Identifies work items for known bugs
Projects
None yet
Development

No branches or pull requests

1 participant