From 00ffe8caec0ec5b211cf1c74abc6d7d95cc05088 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 23 Jun 2026 17:32:49 -0700 Subject: [PATCH] [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 }`. --- Sources/HashTreeCollections/HashNode/_HashNode.swift | 10 +++++----- .../HashTable/_HashTable+CustomStringConvertible.swift | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/HashTreeCollections/HashNode/_HashNode.swift b/Sources/HashTreeCollections/HashNode/_HashNode.swift index b807aef8..f7fc74f3 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode.swift @@ -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 } } } diff --git a/Sources/OrderedCollections/HashTable/_HashTable+CustomStringConvertible.swift b/Sources/OrderedCollections/HashTable/_HashTable+CustomStringConvertible.swift index 2ed4c7f5..1c46ce86 100644 --- a/Sources/OrderedCollections/HashTable/_HashTable+CustomStringConvertible.swift +++ b/Sources/OrderedCollections/HashTable/_HashTable+CustomStringConvertible.swift @@ -50,7 +50,7 @@ extension _HashTable.UnsafeHandle: CustomStringConvertible { extension _HashTable: CustomStringConvertible { @usableFromInline internal var description: String { - read { $0._description(type: "_HashTable") } + self.read { $0._description(type: "_HashTable") } } }