[HashTreeCollections] Avoid parsing issue with func read

When the BorrowAndMutateAccessors feature is enabled, this code appears to be parsed as if it declared a `read` accessor, rather than a getter passing a closure to the `read` function:

```swift
@inlinable
  internal var collisionHash: _Hash {
    read { $0.collisionHash }
  }
```

Avoid this by adding a `self` prefix, as in `self.read { $0.collisionHash }`.
This commit is contained in:
Karoy Lorentey committed 2026-07-07 14:18:09 -07:00
1 parent 8a1438c2b2
commit 00ffe8caec
2 files changed
+6 -6

No files matched your search

@@ -103,27 +103,27 @@ extension _HashNode {
extension _HashNode {
@inlinable
internal var isCollisionNode: Bool {
read { $0.isCollisionNode }
self.read { $0.isCollisionNode }
}
@inlinable
internal var collisionHash: _Hash {
read { $0.collisionHash }
self.read { $0.collisionHash }
}
@inlinable
internal var hasSingletonItem: Bool {
read { $0.hasSingletonItem }
self.read { $0.hasSingletonItem }
}
@inlinable
internal var hasSingletonChild: Bool {
read { $0.hasSingletonChild }
self.read { $0.hasSingletonChild }
}
@inlinable
internal var isAtrophied: Bool {
read { $0.isAtrophiedNode }
self.read { $0.isAtrophiedNode }
}
}