Skip to content

Change NilLiteralExpr_create to NilLiteralExpr.init etc. #68348

@ahoppen

Description

@ahoppen

The NilLiteralExpr_create-style methods look a little foreign in Swift and ideally, they would be constructor calls. This issue talks about the NilLiteralExpr_create function, but it really applies to all the _create functions.

Depending on what we decide to do in #68346, we have three options:

  • Use C++ interop and make the create method static members on NilLiteralExpr
  • Use C++ interop to introduce the NilLiteralExpr type in Swift and import the create method as a constructor on NilLiteralExpr using the SWIFT_NAME attribute (at least I think this should be possible)
  • If we choose to introduce BridgedNilLiteralExpr, we should import NilLiteralExpr_create as an initializer on BridgedNilLiteralExpr using the SWIFT_NAME attribute

Similarly, the AbstractFunctionBody_setBody-style functions should be imported as member functions on the underlying type.

Metadata

Metadata

Assignees

Labels

ASTGenArea → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ ASTcompilerThe Swift compiler itself

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions