|
| 1 | +// |
| 2 | +// AnyAttributeFix.swift |
| 3 | +// OpenSwiftUI |
| 4 | + |
| 5 | +#if !canImport(Darwin) |
| 6 | +package import OpenGraphShims |
| 7 | + |
| 8 | +package typealias AnyAttribute = OpenSwiftUICore.AnyAttribute |
| 9 | +package typealias AttributeInfo = OpenSwiftUICore.AttributeInfo |
| 10 | + |
| 11 | +package typealias AttributeType = OpenSwiftUICore.AttributeType |
| 12 | + |
| 13 | +extension AnyAttribute { |
| 14 | + package static var `nil`: AnyAttribute { AnyAttribute(rawValue: 0x2) } |
| 15 | + |
| 16 | + package var source: AnyAttribute? { |
| 17 | + get { preconditionFailure("#39") } |
| 18 | + nonmutating set { preconditionFailure("#39") } |
| 19 | + } |
| 20 | + |
| 21 | + package var info: AttributeInfo { |
| 22 | + preconditionFailure("#39") |
| 23 | + } |
| 24 | + |
| 25 | + package var graph: Graph { |
| 26 | + preconditionFailure("#39") |
| 27 | + } |
| 28 | + |
| 29 | + package func invalidateValue() { |
| 30 | + preconditionFailure("#39") |
| 31 | + } |
| 32 | + |
| 33 | + package func createIndirect() -> AnyAttribute { |
| 34 | + preconditionFailure("#39") |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +extension AnyAttribute { |
| 39 | + package init<Value>(_ attribute: Attribute<Value>) { |
| 40 | + self = Swift.unsafeBitCast(attribute, to: AnyAttribute.self) |
| 41 | + } |
| 42 | + |
| 43 | + package func unsafeCast<Value>(to type: Value.Type) -> Attribute<Value> { |
| 44 | + Swift.unsafeBitCast(self, to: Attribute<Value>.self) |
| 45 | + } |
| 46 | + |
| 47 | + package static var current: AnyAttribute? { |
| 48 | + preconditionFailure("#39") |
| 49 | + } |
| 50 | + |
| 51 | + package func unsafeOffset(at offset: Int) -> AnyAttribute { |
| 52 | + preconditionFailure("#39") |
| 53 | + } |
| 54 | + |
| 55 | + package func setFlags(_ newFlags: OGAttributeFlags, mask: OGAttributeFlags) { |
| 56 | + preconditionFailure("#39") |
| 57 | + } |
| 58 | + |
| 59 | + package func addInput(_ attribute: AnyAttribute, options: OGInputOptions = [], token: Int) { |
| 60 | + preconditionFailure("#39") |
| 61 | + } |
| 62 | + |
| 63 | + package func addInput<Value>(_ attribute: Attribute<Value>, options: OGInputOptions = [], token: Int) { |
| 64 | + preconditionFailure("#39") |
| 65 | + } |
| 66 | + |
| 67 | + package func visitBody<Visitor>(_ visitor: inout Visitor) where Visitor: AttributeBodyVisitor { |
| 68 | + preconditionFailure("#39") |
| 69 | + } |
| 70 | + |
| 71 | + package func mutateBody<Value>(as: Value.Type, invalidating: Bool, _ body: (inout Value) -> Void) { |
| 72 | + preconditionFailure("#39") |
| 73 | + } |
| 74 | + |
| 75 | + package func breadthFirstSearch(options: OGSearchOptions = [], _: (AnyAttribute) -> Bool) -> Bool { |
| 76 | + preconditionFailure("#39") |
| 77 | + } |
| 78 | + |
| 79 | + package var _bodyType: any Any.Type { |
| 80 | + preconditionFailure("#39") |
| 81 | + } |
| 82 | + |
| 83 | + package var _bodyPointer: UnsafeRawPointer { |
| 84 | + preconditionFailure("#39") |
| 85 | + } |
| 86 | + |
| 87 | + package var valueType: any Any.Type { |
| 88 | + preconditionFailure("#39") |
| 89 | + } |
| 90 | + |
| 91 | + package var indirectDependency: AnyAttribute? { |
| 92 | + get { preconditionFailure("#39") } |
| 93 | + nonmutating set { preconditionFailure("#39") } |
| 94 | + } |
| 95 | +} |
| 96 | + |
| 97 | +extension Attribute { |
| 98 | + package init(identifier: AnyAttribute) { |
| 99 | + self = Swift.unsafeBitCast(identifier.rawValue, to: Attribute.self) |
| 100 | + } |
| 101 | + |
| 102 | + package var identifier: AnyAttribute { |
| 103 | + get { AnyAttribute(rawValue: Swift.unsafeBitCast(self, to: UInt32.self)) } |
| 104 | + nonmutating set { preconditionFailure("#39") } |
| 105 | + } |
| 106 | +} |
| 107 | + |
| 108 | +extension AnyWeakAttribute { |
| 109 | + package var attribute: AnyAttribute? { |
| 110 | + preconditionFailure("#39") |
| 111 | + } |
| 112 | + |
| 113 | + package init(_ attribute: AnyAttribute?) { |
| 114 | + preconditionFailure("#39") |
| 115 | + } |
| 116 | +} |
| 117 | + |
| 118 | +extension IndirectAttribute { |
| 119 | + package var identifier: AnyAttribute { |
| 120 | + AnyAttribute(rawValue: Swift.unsafeBitCast(self, to: UInt32.self)) |
| 121 | + } |
| 122 | +} |
| 123 | + |
| 124 | +extension AnyRuleContext { |
| 125 | + package init(attribute: AnyAttribute) { |
| 126 | + self = Swift.unsafeBitCast(attribute.rawValue, to: AnyRuleContext.self) |
| 127 | + } |
| 128 | + |
| 129 | + package var attribute: AnyAttribute { AnyAttribute(rawValue: Swift.unsafeBitCast(self, to: UInt32.self)) } |
| 130 | +} |
| 131 | + |
| 132 | +extension AnyOptionalAttribute { |
| 133 | + package static var current: AnyOptionalAttribute { |
| 134 | + preconditionFailure("#39") |
| 135 | + } |
| 136 | + |
| 137 | + package var identifier: AnyAttribute { AnyAttribute(rawValue: Swift.unsafeBitCast(self, to: UInt32.self)) } |
| 138 | + |
| 139 | + package var attribute: AnyAttribute? { |
| 140 | + get { preconditionFailure("#39") } |
| 141 | + nonmutating set { preconditionFailure("#39") } |
| 142 | + } |
| 143 | +} |
| 144 | + |
| 145 | +extension Graph { |
| 146 | + package static func setInvalidationCallback(_ graph: Graph, callback: ((AnyAttribute) -> Void)?) { |
| 147 | + preconditionFailure("#39") |
| 148 | + } |
| 149 | +} |
| 150 | + |
| 151 | +extension Subgraph { |
| 152 | + package func forEach(_ flags: OGAttributeFlags, _ callback: (AnyAttribute) -> Void) { |
| 153 | + preconditionFailure("#39") |
| 154 | + } |
| 155 | +} |
| 156 | +#endif |
0 commit comments