Skip to content

Allow parsing for enum case element parameter on new line #1729

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

kimdv
Copy link
Contributor

@kimdv kimdv commented Jun 3, 2023

Resolves #1709

@kimdv kimdv requested a review from ahoppen as a code owner June 3, 2023 22:20
@ahoppen
Copy link
Member

ahoppen commented Jun 7, 2023

CC @bnbarham @rintaro @DougGregor Any concerns with this PR? See #1709 for an explanation of the motivation.

@rintaro
Copy link
Member

rintaro commented Jun 7, 2023

Since func/subscript parameter clause allows newlines before (, it's good to be consistent. Call arguments enforce ( be on the same line, but that is mainly for disambiguation.
TBH I personally don't want to allow newlines before ( even for func, but I couldn't find a strong reason to disallow them.

@DougGregor
Copy link
Member

Since func/subscript parameter clause allows newlines before (, it's good to be consistent.

This is the argument that wins me over. I agree with @rintaro that I'd prefer not to allow newlines before the ( for any of func/decl/subscript/etc. However, since we already allow them, I'd rather be consistent and also allow them for cases. There's no chance for ambiguity here because there are no expressions within an enum scope.

@DougGregor
Copy link
Member

@swift-ci please test

DougGregor

This comment was marked as outdated.

@ahoppen ahoppen enabled auto-merge June 7, 2023 16:55
@ahoppen
Copy link
Member

ahoppen commented Jun 7, 2023

Thanks for your feedback @rintaro and @DougGregor. I agree with you as well, bug just wanted to double-check

@rintaro rintaro disabled auto-merge June 7, 2023 16:56
@kimdv kimdv enabled auto-merge June 7, 2023 19:16
@kimdv kimdv merged commit 5474478 into swiftlang:main Jun 7, 2023
@kimdv kimdv deleted the kimdv/1709-parsing-fails-if-line-break-between-enum-case-element-name-and-parameter-clause branch June 7, 2023 19:20
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.

Parsing fails if line break between enum case element name and parameter clause
4 participants