Skip to content

Commit c53efa4

Browse files
committed
Workaround for rdar://141977987
1 parent 604627d commit c53efa4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftSyntax/Syntax.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable {
6969
}
7070

7171
public var id: SyntaxIdentifier {
72-
SyntaxIdentifier(
73-
rootId: UInt(rawID: arena.root.pointee.raw.id),
72+
// This var is a workaround for a potential compiler bug (rdar://141977987)
73+
let rootDataRef = arena.root
74+
return SyntaxIdentifier(
75+
rootId: UInt(rawID: rootDataRef.pointee.raw.id),
7476
indexInTree: SyntaxIdentifier.SyntaxIndexInTree(indexInTree: absoluteInfo.indexInTree)
7577
)
7678
}

0 commit comments

Comments
 (0)