-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SR-14221: Add tricky parsing test case for trailing closure #36202
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
Conversation
Add tricky parsing test case
@varungandhi-apple Could you please review it? Thanks. |
@swift-ci please smoke test |
Hi, thanks for submitting the patch. Couple of points:
|
test/Parse/trailing_closure.swift
Outdated
func f()->Int{ 42 } | ||
|
||
//This should be interpreted as a trailing closure, instead of being interpreted as a computed property with undesired initial value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Please try to keep the spacing and line widths consistent with the rest of the project. This means that comments should have a space after the //
, and they need to be wrapped to 80 columns.
For functions, the arrow should have spaces on both sides (and similarly, there needs to be a space before an opening brace).
func f()->Int{ 42 } // right now
func f() -> Int { 42 } // match existing style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your kind instruction. I've made the changes. A small question--when will I be qualified to trigger CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a commit access section on https://swift.org/contributing/#contributing-code which describes the details. Usually commit access and swift-ci access are granted together.
@swift-ci smoke test |
CI is passing; merged! 🚢 |
This PR adds a tricky parsing test case to ensure there is a correct interpretation of trailing closure.
Resolves SR-14221