Skip to content

Commit

Permalink
Fix _modify related issue (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye authored Apr 21, 2024
1 parent 4eebdd7 commit 036b8d2
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -179,7 +174,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -206,7 +201,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -229,7 +224,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -264,7 +259,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ extension AGWeakAttribute {
set {
self = AGWeakAttribute(newValue)
}
_modify {
var value = attribute
yield &value
attribute = value
}
}
}

Expand Down Expand Up @@ -175,7 +170,7 @@ public struct WeakAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public var wrappedValue: Value? { get }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set _modify }
public var projectedValue: AttributeGraph.Attribute<Value>?{ get set }
public subscript<Member>(dynamicMember keyPath: Swift.KeyPath<Value, Member>) -> AttributeGraph.Attribute<Member>? { get }
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var value: Value? { get }
Expand All @@ -202,7 +197,7 @@ public struct AnyOptionalAttribute {
public init<Value>(_ attribute: AttributeGraph.OptionalAttribute<Value>)
public var identifier: AGAttribute
public static var current: AttributeGraph.AnyOptionalAttribute { get }
public var attribute: AGAttribute? { get set _modify }
public var attribute: AGAttribute? { get set }
public func map<Value>(_ body: (AGAttribute) -> Value) -> Value?
public func unsafeCast<Value>(to type: Value.Type) -> AttributeGraph.OptionalAttribute<Value>
}
Expand All @@ -225,7 +220,7 @@ public struct OptionalAttribute<Value> {
public init(_ attribute: AttributeGraph.Attribute<Value>)
public init(_ attribute: AttributeGraph.Attribute<Value>?)
public init(_ weakAttribute: AttributeGraph.WeakAttribute<Value>)
public var attribute: AttributeGraph.Attribute<Value>? { get set _modify }
public var attribute: AttributeGraph.Attribute<Value>? { get set }
public var value: Value? { get }
public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)?
public func map<V>(_ body: (AttributeGraph.Attribute<Value>) -> V) -> V?
Expand Down Expand Up @@ -260,7 +255,6 @@ public struct IndirectAttribute<Value> {
public var dependency: AGAttribute? {
get
nonmutating set
nonmutating _modify
}
public var value: Value {
get
Expand Down
Loading

0 comments on commit 036b8d2

Please sign in to comment.