Skip to content

Commit b1767ac

Browse files
committed
Add compatibility inits for remaining effects nodes
1 parent 67b8123 commit b1767ac

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@
1313
// This file provides compatibility aliases to keep dependents of SwiftSyntax building.
1414
// All users of the declarations in this file should transition away from them ASAP.
1515

16+
public extension AccessorEffectSpecifiersSyntax {
17+
@available(*, deprecated, message: "use throwsClause instead of throwsSpecifier")
18+
init(
19+
leadingTrivia: Trivia? = nil,
20+
asyncSpecifier: TokenSyntax? = nil,
21+
throwsSpecifier: TokenSyntax? = nil,
22+
trailingTrivia: Trivia? = nil
23+
) {
24+
self.init(
25+
leadingTrivia: leadingTrivia,
26+
asyncSpecifier: asyncSpecifier,
27+
throwsClause: throwsSpecifier.map { ThrowsClauseSyntax(throwsSpecifier: $0) },
28+
trailingTrivia: trailingTrivia
29+
)
30+
}
31+
}
32+
1633
extension AttributeSyntax {
1734
@available(*, deprecated, renamed: "Arguments")
1835
public typealias Argument = Arguments
@@ -475,6 +492,23 @@ public extension TokenSyntax {
475492
}
476493
}
477494

495+
public extension TypeEffectSpecifiersSyntax {
496+
@available(*, deprecated, message: "use throwsClause instead of throwsSpecifier")
497+
init(
498+
leadingTrivia: Trivia? = nil,
499+
asyncSpecifier: TokenSyntax? = nil,
500+
throwsSpecifier: TokenSyntax? = nil,
501+
trailingTrivia: Trivia? = nil
502+
) {
503+
self.init(
504+
leadingTrivia: leadingTrivia,
505+
asyncSpecifier: asyncSpecifier,
506+
throwsClause: throwsSpecifier.map { ThrowsClauseSyntax(throwsSpecifier: $0) },
507+
trailingTrivia: trailingTrivia
508+
)
509+
}
510+
}
511+
478512
//==========================================================================//
479513
// IMPORTANT: If you are tempted to add a compatibility layer code here //
480514
// please insert it in alphabetical order above //

0 commit comments

Comments
 (0)