Skip to content

Commit 17184f4

Browse files
committed
Specify attributes inside #if before any unconditional attributes
Looks like the Swift 5.7 compiler errors if unconditional attributes are before attributes inside `#if`. Fixes #2546 rdar://124979624
1 parent 18cd7f9 commit 17184f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntaxbuilder/ResultBuildersFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ let resultBuildersFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
3333
"""
3434
// MARK: - \(type.resultBuilderType)
3535
36-
@resultBuilder
3736
\(node.node.apiAttributes())\
37+
@resultBuilder
3838
public struct \(type.resultBuilderType): ListBuilder
3939
"""
4040
) {

Sources/SwiftSyntaxBuilder/generated/ResultBuilders.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,10 @@ public extension LabeledExprListSyntax {
431431

432432
// MARK: - LifetimeSpecifierArgumentListBuilder
433433

434-
@resultBuilder
435434
#if compiler(>=5.8)
436435
@_spi(ExperimentalLanguageFeatures)
437436
#endif
437+
@resultBuilder
438438
public struct LifetimeSpecifierArgumentListBuilder: ListBuilder {
439439
public typealias FinalResult = LifetimeSpecifierArgumentListSyntax
440440
}

0 commit comments

Comments
 (0)