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

Handle ambiguous parsing of return type / restricted type #258

Closed
turbolent opened this issue Jul 23, 2020 · 0 comments · Fixed by #267
Closed

Handle ambiguous parsing of return type / restricted type #258

turbolent opened this issue Jul 23, 2020 · 0 comments · Fixed by #267
Assignees
Labels
Bug Something isn't working

Comments

@turbolent
Copy link
Member

turbolent commented Jul 23, 2020

(Reported by @MaxStalker in https://forum.onflow.org/t/breaking-changes-in-cadence-parser/485)

Problem

The following code parses and executes successfully:

fun main():Int { return 2 }

However, removing the whitespace between the return type and the opening curly brace results in a parsing error:

pub fun main():Int{ return 2 }
Parsing failed: unexpected token: got decimal integer, expected ',' or '}'

Acceptance Criteria

The second example should parse like the first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant