Skip to content

Improvements in FunctionCallExpr convenience initializer #452

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 1 commit into from
May 31, 2022

Conversation

evnik
Copy link
Contributor

@evnik evnik commented May 29, 2022

  • Default values for left/right paren arguments
  • calledExpression accepts ExpressibleAsExprBuildable, so MemberAccessExpr could be passed as well as IdentifierExpr
  • Tests and usages are updated/simplified

@evnik evnik requested a review from ahoppen as a code owner May 29, 2022 23:48
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. This really improves readability of SwiftSyntaxBuilderGeneration.

I’ve got one suggestion inline.

@@ -31,4 +31,22 @@ extension FunctionCallExpr {
additionalTrailingClosures: additionalTrailingClosuresBuilder()
)
}

public init(
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be more general if we changed the ExpressibleAsIdentifierExpr above into ExpressibleByExprBuildable in the convenience initializer above instead of adding another overload.

* Default values for left/right paren arguments
* `calledExpression` accepts `ExpressibleAsExprBuildable`,
  so `MemberAccessExpr` could be passed as well as `IdentifierExpr`
* Tests and usages are updated/simplified
@evnik evnik force-pushed the FunctionCallExpr branch from 91889cd to 0f49356 Compare May 30, 2022 20:49
@evnik evnik changed the title Improvements in FunctionCallExpr convenience initializers Improvements in FunctionCallExpr convenience initializer May 30, 2022
@kimdv
Copy link
Contributor

kimdv commented May 31, 2022

@swift-ci please test

@ahoppen ahoppen merged commit 9efbb3f into swiftlang:main May 31, 2022
@evnik evnik deleted the FunctionCallExpr branch May 31, 2022 15:47
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.

3 participants