Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Scripts/CI/ag_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public import OpenAttributeGraphCxx
@propertyWrapper
@dynamicMemberLookup
public struct WeakAttribute<Value> {
var base: AnyWeakAttribute
public var base: AnyWeakAttribute

public init(base: AnyWeakAttribute) {
self.base = base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading