Skip to content

Commit 8fff0de

Browse files
committed
Workaround for rdar://141977987
1 parent b64f80d commit 8fff0de

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
@@ -73,8 +73,10 @@ public struct Syntax: SyntaxProtocol, SyntaxHashable {
7373
}
7474

7575
public var id: SyntaxIdentifier {
76-
SyntaxIdentifier(
77-
rootId: UInt(rawID: arena.root.pointee.raw.id),
76+
// This var is a workaround for a potential compiler bug (rdar://141977987)
77+
let rootDataRef = arena.root
78+
return SyntaxIdentifier(
79+
rootId: UInt(rawID: rootDataRef.pointee.raw.id),
7880
indexInTree: SyntaxIdentifier.SyntaxIndexInTree(indexInTree: absoluteInfo.indexInTree)
7981
)
8082
}

0 commit comments

Comments
 (0)