Skip to content

Commit 67fbadb

Browse files
authored
Merge pull request #2741 from rintaro/syntax-init-shared
[Syntax] Mark parameter of Syntax.init(_:) casting function
2 parents 8b53f92 + c5526ac commit 67fbadb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftSyntax/Syntax.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,17 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable {
310310
// Inline always so the optimizer can optimize this to a member access on `syntax` without having to go through
311311
// generics.
312312
@inline(__always)
313-
public init(_ syntax: some SyntaxProtocol) {
313+
public init(_ syntax: __shared some SyntaxProtocol) {
314314
self = syntax._syntaxNode
315315
}
316316

317317
/// Creates a new ``Syntax`` node from any node that conforms to ``SyntaxProtocol``.
318-
public init(fromProtocol syntax: SyntaxProtocol) {
318+
public init(fromProtocol syntax: __shared SyntaxProtocol) {
319319
self = syntax._syntaxNode
320320
}
321321

322322
/// Same as ``init(fromProtocol:)`` but returns `nil` if `syntax` is `nil`.
323-
public init?(fromProtocol syntax: SyntaxProtocol?) {
323+
public init?(fromProtocol syntax: __shared SyntaxProtocol?) {
324324
guard let syntax = syntax else { return nil }
325325
self = syntax._syntaxNode
326326
}

0 commit comments

Comments
 (0)