From 5d1cfd67d002536fb751ca81887ba30596b506a2 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 27 Sep 2026 00:58:14 +0800 Subject: [PATCH] fix: use subgraphOrNil across graph backends --- Scripts/CI/ag_setup.sh | 2 +- .../include/OpenAttributeGraph/OAGAttribute.h | 3 +-- Sources/OpenAttributeGraphShims/Adapter/Compute.swift | 2 -- Sources/OpenAttributeGraphShims/Adapter/DanceUIGraph.swift | 2 +- .../Attribute/Attribute/AnyAttributeCompatibilityTests.swift | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Scripts/CI/ag_setup.sh b/Scripts/CI/ag_setup.sh index ad85fca4..bbda6ead 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="157294d5c4d5bde4e13e24347f0f8c50e47c79dc" +DARWINPRIVATEFRAMEWORKS_FALLBACK_REVISION="f917dcc75c52e045a6af30336b2ae63320a9a650" clone_checkout_ag() { cd $REPO_ROOT diff --git a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGAttribute.h b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGAttribute.h index 44312958..ebc4bfac 100644 --- a/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGAttribute.h +++ b/Sources/OpenAttributeGraphCxx/include/OpenAttributeGraph/OAGAttribute.h @@ -147,7 +147,7 @@ OAGSubgraphRef OAGGraphGetAttributeSubgraph(OAGAttribute attribute) OAG_SWIFT_NA OAG_EXPORT OAG_REFINED_FOR_SWIFT -_Nullable OAGSubgraphRef OAGGraphGetAttributeSubgraph2(OAGAttribute attribute) OAG_SWIFT_NAME(getter:OAGAttribute.subgraph2(self:)); +_Nullable OAGSubgraphRef OAGGraphGetAttributeSubgraph2(OAGAttribute attribute) OAG_SWIFT_NAME(getter:OAGAttribute.subgraphOrNil(self:)); OAG_EXPORT OAG_REFINED_FOR_SWIFT @@ -172,4 +172,3 @@ OAG_IMPLICIT_BRIDGING_DISABLED OAG_ASSUME_NONNULL_END #endif /* OAGAttribute_h */ - diff --git a/Sources/OpenAttributeGraphShims/Adapter/Compute.swift b/Sources/OpenAttributeGraphShims/Adapter/Compute.swift index e6be32ba..330f60e7 100644 --- a/Sources/OpenAttributeGraphShims/Adapter/Compute.swift +++ b/Sources/OpenAttributeGraphShims/Adapter/Compute.swift @@ -15,8 +15,6 @@ public typealias OAGValueOptions = IAGValueOptions extension AnyAttribute { public typealias Flags = Subgraph.Flags - - public var subgraph2: Subgraph? { nil } } extension Subgraph { diff --git a/Sources/OpenAttributeGraphShims/Adapter/DanceUIGraph.swift b/Sources/OpenAttributeGraphShims/Adapter/DanceUIGraph.swift index 901fb981..208ea33d 100644 --- a/Sources/OpenAttributeGraphShims/Adapter/DanceUIGraph.swift +++ b/Sources/OpenAttributeGraphShims/Adapter/DanceUIGraph.swift @@ -632,7 +632,7 @@ public struct AnyAttribute: RawRepresentable, Hashable, CustomStringConvertible, Subgraph(base.subgraph) } - public var subgraph2: Subgraph? { + public var subgraphOrNil: Subgraph? { base == .nil ? nil : subgraph } diff --git a/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Attribute/AnyAttributeCompatibilityTests.swift b/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Attribute/AnyAttributeCompatibilityTests.swift index eb587e0f..1fb3f9f1 100644 --- a/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Attribute/AnyAttributeCompatibilityTests.swift +++ b/Tests/OpenAttributeGraphCompatibilityTests/Attribute/Attribute/AnyAttributeCompatibilityTests.swift @@ -105,7 +105,7 @@ struct AnyAttributeCompatibilityTests { @Test func subgraph() { let identifier = Attribute(value: 0).identifier - #expect(identifier.subgraph2 != nil) + #expect(identifier.subgraphOrNil != nil) } @Test