Open
Description
https://github.com/apple/swift/pull/67111/files#diff-de110680caa5f6af695d85ee44bc75ce4693b169e6e537ca176ec3fda17705a8R22-R29 checks that a FunctionCallExprSyntax
has a left parenthesis and a right parenthesis if there are arguments. We need to figure out if it’s ASTGen’s responsibility to performs such checks.
Options are:
- We change the SwiftSyntax tree to make sure that the parenthesis are always present if one of the following conditions is satisfied (which might be tricky)
a. There is a single argument inarguments
or
b. There is no trailing closure - ASTGen performs these checks like it does today
- Since the SwiftSyntax tree is structurally valid without the left and right parenthesis, ASTGen does not need to check these invariants unless it requires the parentheses e.g. to get their locations.
I’m favoring option (3) at the moment