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/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 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