Skip to content

Commit

Permalink
Merge pull request #2920 from rintaro/genricargument-compat-init
Browse files Browse the repository at this point in the history
[Compat] Add GenericArgumentSyntax comatibility initializer
  • Loading branch information
rintaro authored Dec 17, 2024
2 parents 3a53f8f + 3beee4c commit eae92fe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,30 @@ extension EffectSpecifiersSyntax {
}
}

extension GenericArgumentSyntax {
@_disfavoredOverload
@available(*, deprecated, message: "use GenericArgumentSyntax.Argument for 'argument'")
public init(
leadingTrivia: Trivia? = nil,
_ unexpectedBeforeArgument: UnexpectedNodesSyntax? = nil,
argument: some TypeSyntaxProtocol,
_ unexpectedBetweenArgumentAndTrailingComma: UnexpectedNodesSyntax? = nil,
trailingComma: TokenSyntax? = nil,
_ unexpectedAfterTrailingComma: UnexpectedNodesSyntax? = nil,
trailingTrivia: Trivia? = nil
) {
self.init(
leadingTrivia: leadingTrivia,
unexpectedBeforeArgument,
argument: .type(TypeSyntax(argument)),
unexpectedBetweenArgumentAndTrailingComma,
trailingComma: trailingComma,
unexpectedAfterTrailingComma,
trailingTrivia: trailingTrivia
)
}
}

extension FunctionEffectSpecifiersSyntax {
@_disfavoredOverload
@available(*, deprecated, message: "use throwsClause instead of throwsSpecifier")
Expand Down

0 comments on commit eae92fe

Please sign in to comment.