swiftlang / swiftlang/swift-syntax
Adds explicit overload for `ExpressibleByStringLiteral` syntax types
Open
enhancement
- Dominant language
- Swift
- Stars
- 3.7k
- Forks
- 553
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 16
Description
### Description
Nowadays we have `DeclSyntax`, `ExprSyntax`, `StmtSyntax`, `TokenSyntax`, `TypeSyntax`... with `ExpressibleByStringLiteral` conformance. If an initializer takes a concrete-typed parameter of one of these types, string literal syntax works perfectly, reducing lots of boilerplate codes.
However, for initializers with generic parameters like ``, such syntax won't work and we need to explicitly express out `ExprSyntax("...")` or `"..." as ExprSyntax`. Adding an overload with concrete type `ExprSyntax` can solve the problem, making `SwiftSyntaxBuilder` easier to use.
Contributor guide
Assessment
This issue has not been assessed yet.