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 parsing invalid function parameters #2927

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Dec 23, 2024

Fixes #2254

@kimdv kimdv force-pushed the kimdv/fix-issue-2254 branch from f538bf6 to 49cbb92 Compare December 23, 2024 21:23
@kimdv kimdv force-pushed the kimdv/fix-issue-2254 branch from 49cbb92 to a5831b5 Compare December 23, 2024 21:24
@kimdv
Copy link
Contributor Author

kimdv commented Dec 23, 2024

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me. I think just a few tests need to be updated.

@kimdv
Copy link
Contributor Author

kimdv commented Jan 4, 2025

Thanks. Looks good to me. I think just a few tests need to be updated.

Not sure what is right.
We have the test case testInitAccessorsWithDefaultValues.

It will change init(initialValue: <#type#>) {} -> init(<#identifier#>: initialValue) {}.

I think this is more wrong.

Would it make sense to assume that if it starts with a lower case, it's an identifier and if it starts with an uppercase it's a type?

@ahoppen
Copy link
Member

ahoppen commented Jan 5, 2025

Would it make sense to assume that if it starts with a lower case, it's an identifier and if it starts with an uppercase it's a type?

I think that’s very reasonable behavior for error recovery. I have wanted to do this in some case in the past but I think that change never made to to a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

swift syntax should be able to recover function parameters without argument labels
3 participants