Skip to content

Conversation

@hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Oct 23, 2023

For nullable nodes, introduce both a non-null and nullable variant of the bridging wrapper. This allows us to annotate the necessary parameters as nullable, but keep the returns of the bridged createParsed methods non-null.

@hamishknight hamishknight added the ASTGen Area → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ AST label Oct 23, 2023
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.

I like this design but I’d like to hear @rintaro’s and @bnbarham’s thoughts on this as well.

For nullable nodes, introduce both a non-null and
nullable variant of the bridging wrapper. This
allows us to annotate the necessary parameters
as nullable, but keep the returns of the bridged
`createParsed` methods non-null.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

The asNullable is a little unfortunate, but I'm in favor of this given all the places that don't allow nullable but took them anyway.

@hamishknight hamishknight merged commit d1fa767 into swiftlang:main Oct 23, 2023
@hamishknight hamishknight deleted the null-and-void branch October 23, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASTGen Area → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ AST

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants