We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FunctionDeclSyntax does not expand body as expected.
let functionDeclaration = FunctionDeclSyntax( name: .identifier("foo"), signature: FunctionSignatureSyntax(parameterClause: FunctionParameterClauseSyntax(parameters: [])), body: CodeBlockSyntax(statements: []) )
will expand to
func foo()
no body
No response
The text was updated successfully, but these errors were encountered:
Synced to Apple’s issue tracker as rdar://137723591
Sorry, something went wrong.
I was unable to reproduce the issue.
let functionDeclaration = FunctionDeclSyntax( name: .identifier("foo"), signature: FunctionSignatureSyntax(parameterClause: FunctionParameterClauseSyntax(parameters: [])), body: CodeBlockSyntax(statements: []) ) print(functionDeclaration.formatted())
prints
func foo() { }
Which contains a body.
Are you doing anything differently? If so, can you share a reproducing project?
I am sorry. I found the body of the function was removed by a body macro that with a implementation of return []
return []
No branches or pull requests
Description
FunctionDeclSyntax does not expand body as expected.
will expand to
no body
Steps to Reproduce
No response
The text was updated successfully, but these errors were encountered: