From ae157a79a7eaf919bc56d3917858a18ad148e58d Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 6 Sep 2026 22:38:31 +0800 Subject: [PATCH 1/2] Make WeakAttribute.base public --- Sources/OpenAttributeGraph/Attribute/Weak/WeakAttribute.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/OpenAttributeGraph/Attribute/Weak/WeakAttribute.swift b/Sources/OpenAttributeGraph/Attribute/Weak/WeakAttribute.swift index d4135419..6e960f17 100644 --- a/Sources/OpenAttributeGraph/Attribute/Weak/WeakAttribute.swift +++ b/Sources/OpenAttributeGraph/Attribute/Weak/WeakAttribute.swift @@ -38,7 +38,7 @@ public import OpenAttributeGraphCxx @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - var base: AnyWeakAttribute + public var base: AnyWeakAttribute public init(base: AnyWeakAttribute) { self.base = base From e2ab8d03031e234f28831710330ce89f551a53f2 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 7 Sep 2026 23:11:35 +0800 Subject: [PATCH 2/2] Test WeakAttribute.base compatibility --- Scripts/CI/ag_setup.sh | 2 +- .../Weak/WeakAttributeCompatibilityTests.swift | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Scripts/CI/ag_setup.sh b/Scripts/CI/ag_setup.sh index 2962dc5f..ad85fca4 100755 --- a/Scripts/CI/ag_setup.sh +++ b/Scripts/CI/ag_setup.sh @@ -6,7 +6,7 @@ filepath() { } REPO_ROOT="$(dirname $(dirname $(dirname $(filepath $0))))" -DARWINPRIVATEFRAMEWORKS_FALLBACK_REVISION="0cec3b3219dd2d99818e861e3dca7598e7554f98" +DARWINPRIVATEFRAMEWORKS_FALLBACK_REVISION="157294d5c4d5bde4e13e24347f0f8c50e47c79dc" clone_checkout_ag() { cd $REPO_ROOT diff --git a/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Weak/WeakAttributeCompatibilityTests.swift b/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Weak/WeakAttributeCompatibilityTests.swift index a4976f7b..f471e23f 100644 --- a/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Weak/WeakAttributeCompatibilityTests.swift +++ b/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Weak/WeakAttributeCompatibilityTests.swift @@ -15,5 +15,21 @@ struct WeakAttributeCompatibilityTests { let attr = Attribute(value: 0) _ = WeakAttribute(attr) } + + @Test + func base() { + let first = Attribute(value: 1) + let second = Attribute(value: 2) + var weak = WeakAttribute(first) + #expect(weak.base == AnyWeakAttribute(first.identifier)) + + weak.base = AnyWeakAttribute(second.identifier) + #expect(weak.attribute == second) + #expect(weak.wrappedValue == 2) + + weak.base = AnyWeakAttribute(nil) + #expect(weak.attribute == nil) + #expect(weak.wrappedValue == nil) + } } #endif