@@ -26,7 +26,7 @@ public protocol DeclSyntaxProtocol: SyntaxProtocol {}
2626/// These methods enable casting between syntax node types within the same
2727/// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``).
2828///
29- /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
29+ /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
3030/// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't
3131/// appropriate for use on types conforming to a specific base node protocol
3232/// like ``DeclSyntaxProtocol``. That's because at this level,
@@ -35,7 +35,7 @@ public protocol DeclSyntaxProtocol: SyntaxProtocol {}
3535///
3636/// To guide developers toward correct usage, this extension provides overloads
3737/// of these casting methods that are restricted to the same base node type.
38- /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
38+ /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
3939/// deprecated, indicating that they will always fail when used in this context.
4040extension DeclSyntaxProtocol {
4141 /// Checks if the current syntax node can be cast to a given specialized syntax type.
@@ -184,9 +184,8 @@ public struct DeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
184184
185185 /// Create a ``DeclSyntax`` node from a specialized syntax node.
186186 public init ( _ syntax: __shared some DeclSyntaxProtocol ) {
187- // We know this cast is going to succeed. Go through init(_: SyntaxData)
188- // to do a sanity check and verify the kind matches in debug builds and get
189- // maximum performance in release builds.
187+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
188+ // verify the kind matches in debug builds and get maximum performance in release builds.
190189 self = Syntax ( syntax) . cast ( Self . self)
191190 }
192191
@@ -199,9 +198,8 @@ public struct DeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
199198 }
200199
201200 public init ( fromProtocol syntax: __shared DeclSyntaxProtocol) {
202- // We know this cast is going to succeed. Go through init(_: SyntaxData)
203- // to do a sanity check and verify the kind matches in debug builds and get
204- // maximum performance in release builds.
201+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
202+ // verify the kind matches in debug builds and get maximum performance in release builds.
205203 self = Syntax ( syntax) . cast ( Self . self)
206204 }
207205
@@ -327,7 +325,7 @@ public protocol ExprSyntaxProtocol: SyntaxProtocol {}
327325/// These methods enable casting between syntax node types within the same
328326/// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``).
329327///
330- /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
328+ /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
331329/// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't
332330/// appropriate for use on types conforming to a specific base node protocol
333331/// like ``ExprSyntaxProtocol``. That's because at this level,
@@ -336,7 +334,7 @@ public protocol ExprSyntaxProtocol: SyntaxProtocol {}
336334///
337335/// To guide developers toward correct usage, this extension provides overloads
338336/// of these casting methods that are restricted to the same base node type.
339- /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
337+ /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
340338/// deprecated, indicating that they will always fail when used in this context.
341339extension ExprSyntaxProtocol {
342340 /// Checks if the current syntax node can be cast to a given specialized syntax type.
@@ -512,9 +510,8 @@ public struct ExprSyntax: ExprSyntaxProtocol, SyntaxHashable {
512510
513511 /// Create a ``ExprSyntax`` node from a specialized syntax node.
514512 public init ( _ syntax: __shared some ExprSyntaxProtocol ) {
515- // We know this cast is going to succeed. Go through init(_: SyntaxData)
516- // to do a sanity check and verify the kind matches in debug builds and get
517- // maximum performance in release builds.
513+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
514+ // verify the kind matches in debug builds and get maximum performance in release builds.
518515 self = Syntax ( syntax) . cast ( Self . self)
519516 }
520517
@@ -527,9 +524,8 @@ public struct ExprSyntax: ExprSyntaxProtocol, SyntaxHashable {
527524 }
528525
529526 public init ( fromProtocol syntax: __shared ExprSyntaxProtocol) {
530- // We know this cast is going to succeed. Go through init(_: SyntaxData)
531- // to do a sanity check and verify the kind matches in debug builds and get
532- // maximum performance in release builds.
527+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
528+ // verify the kind matches in debug builds and get maximum performance in release builds.
533529 self = Syntax ( syntax) . cast ( Self . self)
534530 }
535531
@@ -685,7 +681,7 @@ public protocol PatternSyntaxProtocol: SyntaxProtocol {}
685681/// These methods enable casting between syntax node types within the same
686682/// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``).
687683///
688- /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
684+ /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
689685/// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't
690686/// appropriate for use on types conforming to a specific base node protocol
691687/// like ``PatternSyntaxProtocol``. That's because at this level,
@@ -694,7 +690,7 @@ public protocol PatternSyntaxProtocol: SyntaxProtocol {}
694690///
695691/// To guide developers toward correct usage, this extension provides overloads
696692/// of these casting methods that are restricted to the same base node type.
697- /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
693+ /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
698694/// deprecated, indicating that they will always fail when used in this context.
699695extension PatternSyntaxProtocol {
700696 /// Checks if the current syntax node can be cast to a given specialized syntax type.
@@ -826,9 +822,8 @@ public struct PatternSyntax: PatternSyntaxProtocol, SyntaxHashable {
826822
827823 /// Create a ``PatternSyntax`` node from a specialized syntax node.
828824 public init ( _ syntax: __shared some PatternSyntaxProtocol ) {
829- // We know this cast is going to succeed. Go through init(_: SyntaxData)
830- // to do a sanity check and verify the kind matches in debug builds and get
831- // maximum performance in release builds.
825+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
826+ // verify the kind matches in debug builds and get maximum performance in release builds.
832827 self = Syntax ( syntax) . cast ( Self . self)
833828 }
834829
@@ -841,9 +836,8 @@ public struct PatternSyntax: PatternSyntaxProtocol, SyntaxHashable {
841836 }
842837
843838 public init ( fromProtocol syntax: __shared PatternSyntaxProtocol) {
844- // We know this cast is going to succeed. Go through init(_: SyntaxData)
845- // to do a sanity check and verify the kind matches in debug builds and get
846- // maximum performance in release builds.
839+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
840+ // verify the kind matches in debug builds and get maximum performance in release builds.
847841 self = Syntax ( syntax) . cast ( Self . self)
848842 }
849843
@@ -952,7 +946,7 @@ public protocol StmtSyntaxProtocol: SyntaxProtocol {}
952946/// These methods enable casting between syntax node types within the same
953947/// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``).
954948///
955- /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
949+ /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
956950/// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't
957951/// appropriate for use on types conforming to a specific base node protocol
958952/// like ``StmtSyntaxProtocol``. That's because at this level,
@@ -961,7 +955,7 @@ public protocol StmtSyntaxProtocol: SyntaxProtocol {}
961955///
962956/// To guide developers toward correct usage, this extension provides overloads
963957/// of these casting methods that are restricted to the same base node type.
964- /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
958+ /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
965959/// deprecated, indicating that they will always fail when used in this context.
966960extension StmtSyntaxProtocol {
967961 /// Checks if the current syntax node can be cast to a given specialized syntax type.
@@ -1102,9 +1096,8 @@ public struct StmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
11021096
11031097 /// Create a ``StmtSyntax`` node from a specialized syntax node.
11041098 public init ( _ syntax: __shared some StmtSyntaxProtocol ) {
1105- // We know this cast is going to succeed. Go through init(_: SyntaxData)
1106- // to do a sanity check and verify the kind matches in debug builds and get
1107- // maximum performance in release builds.
1099+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
1100+ // verify the kind matches in debug builds and get maximum performance in release builds.
11081101 self = Syntax ( syntax) . cast ( Self . self)
11091102 }
11101103
@@ -1117,9 +1110,8 @@ public struct StmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
11171110 }
11181111
11191112 public init ( fromProtocol syntax: __shared StmtSyntaxProtocol) {
1120- // We know this cast is going to succeed. Go through init(_: SyntaxData)
1121- // to do a sanity check and verify the kind matches in debug builds and get
1122- // maximum performance in release builds.
1113+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
1114+ // verify the kind matches in debug builds and get maximum performance in release builds.
11231115 self = Syntax ( syntax) . cast ( Self . self)
11241116 }
11251117
@@ -1238,7 +1230,7 @@ public protocol TypeSyntaxProtocol: SyntaxProtocol {}
12381230/// These methods enable casting between syntax node types within the same
12391231/// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``).
12401232///
1241- /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
1233+ /// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
12421234/// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't
12431235/// appropriate for use on types conforming to a specific base node protocol
12441236/// like ``TypeSyntaxProtocol``. That's because at this level,
@@ -1247,7 +1239,7 @@ public protocol TypeSyntaxProtocol: SyntaxProtocol {}
12471239///
12481240/// To guide developers toward correct usage, this extension provides overloads
12491241/// of these casting methods that are restricted to the same base node type.
1250- /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
1242+ /// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
12511243/// deprecated, indicating that they will always fail when used in this context.
12521244extension TypeSyntaxProtocol {
12531245 /// Checks if the current syntax node can be cast to a given specialized syntax type.
@@ -1390,9 +1382,8 @@ public struct TypeSyntax: TypeSyntaxProtocol, SyntaxHashable {
13901382
13911383 /// Create a ``TypeSyntax`` node from a specialized syntax node.
13921384 public init ( _ syntax: __shared some TypeSyntaxProtocol ) {
1393- // We know this cast is going to succeed. Go through init(_: SyntaxData)
1394- // to do a sanity check and verify the kind matches in debug builds and get
1395- // maximum performance in release builds.
1385+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
1386+ // verify the kind matches in debug builds and get maximum performance in release builds.
13961387 self = Syntax ( syntax) . cast ( Self . self)
13971388 }
13981389
@@ -1405,9 +1396,8 @@ public struct TypeSyntax: TypeSyntaxProtocol, SyntaxHashable {
14051396 }
14061397
14071398 public init ( fromProtocol syntax: __shared TypeSyntaxProtocol) {
1408- // We know this cast is going to succeed. Go through init(_: SyntaxData)
1409- // to do a sanity check and verify the kind matches in debug builds and get
1410- // maximum performance in release builds.
1399+ // We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
1400+ // verify the kind matches in debug builds and get maximum performance in release builds.
14111401 self = Syntax ( syntax) . cast ( Self . self)
14121402 }
14131403
0 commit comments