Skip to content

Commit 6d5fb4e

Browse files
authored
Merge pull request swiftlang#336 from kimdv/kimdv/make-array-conform-to-expressible-as
2 parents 7117363 + 0102d5d commit 6d5fb4e

File tree

3 files changed

+275
-0
lines changed

3 files changed

+275
-0
lines changed

Sources/SwiftSyntaxBuilder/Buildables.swift.gyb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@ public struct ${node.syntax_kind}: SyntaxBuildable {
265265
}
266266
}
267267

268+
extension ${node.syntax_kind}: ExpressibleByArrayLiteral {
269+
% extension_protocol = element_type if element_type is 'TokenSyntax' else 'ExpressibleAs' + element_type
270+
public init(arrayLiteral elements: ${extension_protocol}...) {
271+
self.init(elements)
272+
}
273+
}
274+
268275
% end
269276
% if node.is_buildable() or node.is_syntax_collection():
270277
% expressible_as_type = 'ExpressibleAs' + node.syntax_kind

0 commit comments

Comments
 (0)