Skip to content

Remove convenience initializers #1300

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

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Jan 31, 2023

No description provided.

@kimdv kimdv requested a review from ahoppen as a code owner January 31, 2023 15:19
@kimdv
Copy link
Contributor Author

kimdv commented Jan 31, 2023

@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.

Thank you.

I just went through the convenience initializers as well and think the following changes would also make sense. If you’ve got time, I think it would be good to do them in this PR. But we can also merge this as-is and I’ll create a follow-up PR

  • FunctionParameterSyntax should take a PartialSyntaxNodeString instead of a String
  • I think SwitchCaseSyntax could also be represented as a convenience initializer in SyntaxNodeWithBody.swift
  • Rename the MARK: CustomAttribute to MARK: Attribute and sort it to the top of the file to maintain alphabetical order

@kimdv
Copy link
Contributor Author

kimdv commented Feb 1, 2023

Will add them to this PR

@kimdv kimdv force-pushed the kimdv/remove-convenience-initializers branch 2 times, most recently from 25bee47 to 9381ce5 Compare February 1, 2023 07:35
@kimdv
Copy link
Contributor Author

kimdv commented Feb 1, 2023

@ahoppen should TupleExprElementSyntax I also replace the string with an PartialSyntaxNodeString and then change to label: label.map { TokenSyntax("\($0)") }

@kimdv kimdv changed the title Kimdv/remove convenience initializers Remove convenience initializers Feb 1, 2023
@kimdv kimdv force-pushed the kimdv/remove-convenience-initializers branch from 6cc4088 to 9b4dd73 Compare February 1, 2023 09:14
@kimdv kimdv requested a review from ahoppen February 1, 2023 09:14
@kimdv
Copy link
Contributor Author

kimdv commented Feb 1, 2023

Also removed the one from IfStmtSyntax as there is one in SyntaxNodeWithBody.swift

@kimdv
Copy link
Contributor Author

kimdv commented Feb 1, 2023

Also removed TernaryExprSyntax as we can use ExprSyntax now

@kimdv
Copy link
Contributor Author

kimdv commented Feb 1, 2023

@swift-ci please test

@ahoppen
Copy link
Member

ahoppen commented Feb 1, 2023

@ahoppen should TupleExprElementSyntax I also replace the string with an PartialSyntaxNodeString and then change to label: label.map { TokenSyntax("\($0)") }

For TupleExprElementSyntax it’s fine since we aren’t parsing the string – we are using it as the contents of an identifier.

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.

Thank you!

@ahoppen
Copy link
Member

ahoppen commented Feb 1, 2023

@swift-ci Please test

@kimdv kimdv force-pushed the kimdv/remove-convenience-initializers branch from 49c0020 to 9d1db4e Compare February 1, 2023 20:29
@kimdv
Copy link
Contributor Author

kimdv commented Feb 1, 2023

@swift-ci please test

@kimdv kimdv merged commit c49e6e1 into swiftlang:main Feb 2, 2023
@kimdv kimdv deleted the kimdv/remove-convenience-initializers branch February 9, 2023 14:19
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.

2 participants