@@ -21,20 +21,20 @@ extension FunctionCallExprSyntax: CallingExprSyntaxProtocol {}
2121extension SubscriptCallExprSyntax : CallingExprSyntaxProtocol { }
2222
2323extension Syntax {
24- func asProtocol( _: CallingExprSyntaxProtocol . Protocol ) -> CallingExprSyntaxProtocol ? {
25- return self . asProtocol ( SyntaxProtocol . self) as? CallingExprSyntaxProtocol
24+ func asProtocol( _: ( any CallingExprSyntaxProtocol ) . Protocol) -> ( any CallingExprSyntaxProtocol ) ? {
25+ return self . asProtocol ( ( any SyntaxProtocol ) . self) as? ( any CallingExprSyntaxProtocol )
2626 }
27- func isProtocol( _: CallingExprSyntaxProtocol . Protocol ) -> Bool {
28- return self . asProtocol ( CallingExprSyntaxProtocol . self) != nil
27+ func isProtocol( _: ( any CallingExprSyntaxProtocol ) . Protocol) -> Bool {
28+ return self . asProtocol ( ( any CallingExprSyntaxProtocol ) . self) != nil
2929 }
3030}
3131
3232extension ExprSyntax {
33- func asProtocol( _: CallingExprSyntaxProtocol . Protocol ) -> CallingExprSyntaxProtocol ? {
34- return Syntax ( self ) . asProtocol ( SyntaxProtocol . self) as? CallingExprSyntaxProtocol
33+ func asProtocol( _: ( any CallingExprSyntaxProtocol ) . Protocol) -> ( any CallingExprSyntaxProtocol ) ? {
34+ return Syntax ( self ) . asProtocol ( ( any SyntaxProtocol ) . self) as? ( any CallingExprSyntaxProtocol )
3535 }
36- func isProtocol( _: CallingExprSyntaxProtocol . Protocol ) -> Bool {
37- return self . asProtocol ( CallingExprSyntaxProtocol . self) != nil
36+ func isProtocol( _: ( any CallingExprSyntaxProtocol ) . Protocol) -> Bool {
37+ return self . asProtocol ( ( any CallingExprSyntaxProtocol ) . self) != nil
3838 }
3939}
4040
@@ -49,41 +49,41 @@ extension TryExprSyntax: KeywordModifiedExprSyntaxProtocol {}
4949extension UnsafeExprSyntax : KeywordModifiedExprSyntaxProtocol { }
5050
5151extension Syntax {
52- func asProtocol( _: KeywordModifiedExprSyntaxProtocol . Protocol ) -> KeywordModifiedExprSyntaxProtocol ? {
53- return self . asProtocol ( SyntaxProtocol . self) as? KeywordModifiedExprSyntaxProtocol
52+ func asProtocol( _: ( any KeywordModifiedExprSyntaxProtocol ) . Protocol) -> ( any KeywordModifiedExprSyntaxProtocol ) ? {
53+ return self . asProtocol ( ( any SyntaxProtocol ) . self) as? ( any KeywordModifiedExprSyntaxProtocol )
5454 }
55- func isProtocol( _: KeywordModifiedExprSyntaxProtocol . Protocol ) -> Bool {
56- return self . asProtocol ( KeywordModifiedExprSyntaxProtocol . self) != nil
55+ func isProtocol( _: ( any KeywordModifiedExprSyntaxProtocol ) . Protocol) -> Bool {
56+ return self . asProtocol ( ( any KeywordModifiedExprSyntaxProtocol ) . self) != nil
5757 }
5858}
5959
6060extension ExprSyntax {
61- func asProtocol( _: KeywordModifiedExprSyntaxProtocol . Protocol ) -> KeywordModifiedExprSyntaxProtocol ? {
62- return Syntax ( self ) . asProtocol ( SyntaxProtocol . self) as? KeywordModifiedExprSyntaxProtocol
61+ func asProtocol( _: ( any KeywordModifiedExprSyntaxProtocol ) . Protocol) -> ( any KeywordModifiedExprSyntaxProtocol ) ? {
62+ return Syntax ( self ) . asProtocol ( ( any SyntaxProtocol ) . self) as? ( any KeywordModifiedExprSyntaxProtocol )
6363 }
64- func isProtocol( _: KeywordModifiedExprSyntaxProtocol . Protocol ) -> Bool {
65- return self . asProtocol ( KeywordModifiedExprSyntaxProtocol . self) != nil
64+ func isProtocol( _: ( any KeywordModifiedExprSyntaxProtocol ) . Protocol) -> Bool {
65+ return self . asProtocol ( ( any KeywordModifiedExprSyntaxProtocol ) . self) != nil
6666 }
6767}
6868
6969/// Common protocol implemented by comma-separated lists whose elements
7070/// support a `trailingComma`.
7171protocol CommaSeparatedListSyntaxProtocol : SyntaxCollection where Element: WithTrailingCommaSyntax & Equatable {
7272 /// The node used for trailing comma handling; inserted immediately after this node.
73- var lastNodeForTrailingComma : SyntaxProtocol ? { get }
73+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? { get }
7474}
7575
7676extension ArrayElementListSyntax : CommaSeparatedListSyntaxProtocol {
77- var lastNodeForTrailingComma : SyntaxProtocol ? { last? . expression }
77+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? { last? . expression }
7878}
7979extension DictionaryElementListSyntax : CommaSeparatedListSyntaxProtocol {
80- var lastNodeForTrailingComma : SyntaxProtocol ? { last }
80+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? { last }
8181}
8282extension LabeledExprListSyntax : CommaSeparatedListSyntaxProtocol {
83- var lastNodeForTrailingComma : SyntaxProtocol ? { last? . expression }
83+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? { last? . expression }
8484}
8585extension ClosureCaptureListSyntax : CommaSeparatedListSyntaxProtocol {
86- var lastNodeForTrailingComma : SyntaxProtocol ? {
86+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? {
8787 if let initializer = last? . initializer {
8888 return initializer
8989 } else {
@@ -92,7 +92,7 @@ extension ClosureCaptureListSyntax: CommaSeparatedListSyntaxProtocol {
9292 }
9393}
9494extension EnumCaseParameterListSyntax : CommaSeparatedListSyntaxProtocol {
95- var lastNodeForTrailingComma : SyntaxProtocol ? {
95+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? {
9696 if let defaultValue = last? . defaultValue {
9797 return defaultValue
9898 } else {
@@ -101,7 +101,7 @@ extension EnumCaseParameterListSyntax: CommaSeparatedListSyntaxProtocol {
101101 }
102102}
103103extension FunctionParameterListSyntax : CommaSeparatedListSyntaxProtocol {
104- var lastNodeForTrailingComma : SyntaxProtocol ? {
104+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? {
105105 if let defaultValue = last? . defaultValue {
106106 return defaultValue
107107 } else if let ellipsis = last? . ellipsis {
@@ -112,7 +112,7 @@ extension FunctionParameterListSyntax: CommaSeparatedListSyntaxProtocol {
112112 }
113113}
114114extension GenericParameterListSyntax : CommaSeparatedListSyntaxProtocol {
115- var lastNodeForTrailingComma : SyntaxProtocol ? {
115+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? {
116116 if let inheritedType = last? . inheritedType {
117117 return inheritedType
118118 } else {
@@ -121,12 +121,12 @@ extension GenericParameterListSyntax: CommaSeparatedListSyntaxProtocol {
121121 }
122122}
123123extension TuplePatternElementListSyntax : CommaSeparatedListSyntaxProtocol {
124- var lastNodeForTrailingComma : SyntaxProtocol ? { last? . pattern }
124+ var lastNodeForTrailingComma : ( any SyntaxProtocol ) ? { last? . pattern }
125125}
126126
127127extension SyntaxProtocol {
128128 func asProtocol( _: ( any CommaSeparatedListSyntaxProtocol ) . Protocol) -> ( any CommaSeparatedListSyntaxProtocol ) ? {
129- return Syntax ( self ) . asProtocol ( SyntaxProtocol . self) as? ( any CommaSeparatedListSyntaxProtocol )
129+ return Syntax ( self ) . asProtocol ( ( any SyntaxProtocol ) . self) as? ( any CommaSeparatedListSyntaxProtocol )
130130 }
131131 func isProtocol( _: ( any CommaSeparatedListSyntaxProtocol ) . Protocol) -> Bool {
132132 return self . asProtocol ( ( any CommaSeparatedListSyntaxProtocol ) . self) != nil
0 commit comments