Skip to content

Commit c5aa935

Browse files
committed
Fix build failure due to two PRs racing
SwiftSyntax failed to build because swiftlang#539 and swiftlang#578 conflicted
1 parent c1299b5 commit c5aa935

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

Sources/SwiftSyntax/gyb_generated/SyntaxFactory.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public enum SyntaxFactory {
9696
], length: .zero, presence: presence))
9797
return MissingSyntax(data)
9898
}
99+
@available(*, deprecated, message: "Use initializer on MissingDeclSyntax")
99100
public static func makeMissingDecl(_ garbageBeforeAttributes: GarbageNodesSyntax? = nil, attributes: AttributeListSyntax?, _ garbageBetweenAttributesAndModifiers: GarbageNodesSyntax? = nil, modifiers: ModifierListSyntax?) -> MissingDeclSyntax {
100101
let layout: [RawSyntax?] = [
101102
garbageBeforeAttributes?.raw,

Sources/SwiftSyntax/gyb_generated/syntax_nodes/SyntaxDeclNodes.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,16 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
9090
}
9191

9292
public init(
93+
_ garbageBeforeAttributes: GarbageNodesSyntax? = nil,
94+
attributes: AttributeListSyntax?,
95+
_ garbageBetweenAttributesAndModifiers: GarbageNodesSyntax? = nil,
96+
modifiers: ModifierListSyntax?
9397
) {
9498
let layout: [RawSyntax?] = [
99+
garbageBeforeAttributes?.raw,
100+
attributes?.raw,
101+
garbageBetweenAttributesAndModifiers?.raw,
102+
modifiers?.raw,
95103
]
96104
let raw = RawSyntax.createAndCalcLength(kind: SyntaxKind.missingDecl,
97105
layout: layout, presence: SourcePresence.present)

Tests/SwiftSyntaxTest/SyntaxChildrenTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public class SyntaxChildrenTests: XCTestCase {
5050
}
5151

5252
public func testMissingNodes() throws {
53-
let node = DeclarationStmtSyntax(declaration: DeclSyntax(MissingDeclSyntax()))
53+
let node = DeclarationStmtSyntax(declaration: DeclSyntax(MissingDeclSyntax(
54+
attributes: nil,
55+
modifiers: nil
56+
)))
5457

5558
var sourceAccurateIt = node.children(viewMode: .sourceAccurate).makeIterator()
5659
XCTAssertNextIsNil(&sourceAccurateIt)

Tests/SwiftSyntaxTest/VisitorTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import SwiftSyntax
33

44
public class VisitorTests: XCTestCase {
55
public func testVisitMissingNodes() throws {
6-
let node = DeclarationStmtSyntax(declaration: DeclSyntax(MissingDeclSyntax()))
6+
let node = DeclarationStmtSyntax(declaration: DeclSyntax(MissingDeclSyntax(
7+
attributes: nil,
8+
modifiers: nil
9+
)))
710

811
class MissingDeclChecker: SyntaxVisitor {
912
var didSeeMissingDeclSyntax = false

0 commit comments

Comments
 (0)