Skip to content

Commit de176ec

Browse files
committed
Fix compiler error
1 parent 2819341 commit de176ec

File tree

10 files changed

+305
-313
lines changed

10 files changed

+305
-313
lines changed

Sources/OpenSwiftUI/Core/Graph/GraphHost.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class GraphHost {
138138

139139
// TODO: _ArchivedViewHost.reset()
140140
final func incrementPhase() {
141-
data.phase.value += 2
141+
// data.phase.value += 2
142142
graphDelegate?.graphDidChange()
143143
}
144144

@@ -338,12 +338,13 @@ extension GraphHost {
338338
_phase = phase
339339
_hostPreferenceKeys = hostPreferenceKeys
340340
_transaction = transaction
341-
inputs = _GraphInputs(
342-
time: time,
343-
cachedEnvironment: cachedEnvironment,
344-
phase: phase,
345-
transaction: transaction
346-
)
341+
// inputs = _GraphInputs(
342+
// time: time,
343+
// cachedEnvironment: cachedEnvironment,
344+
// phase: phase,
345+
// transaction: transaction
346+
// )
347+
fatalError("TODO")
347348
}
348349
}
349350
}

Sources/OpenSwiftUI/Core/Graph/GraphInput.swift

Lines changed: 0 additions & 125 deletions
This file was deleted.

Sources/OpenSwiftUI/Data/Environment/DerivedEnvironmentKey.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.

Sources/OpenSwiftUI/Data/Environment/EnvironmentKeyTransformModifier.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public struct _EnvironmentKeyTransformModifier<Value>: PrimitiveViewModifier, _G
2626
oldKeyPath: nil
2727
)
2828
let attribute = Attribute(childEnvironment)
29-
let cachedEnvironment = CachedEnvironment(attribute)
30-
inputs.updateCachedEnvironment(MutableBox(cachedEnvironment))
29+
inputs.environment = attribute
3130
}
3231
}
3332

Sources/OpenSwiftUI/Data/Model/DynamicProperty/DynamicProperty.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ extension DynamicBody: StatefulRule {
229229
typealias Value = Accessor.Body
230230

231231
mutating func updateValue() {
232-
if resetSeed != phase.seed {
233-
links.reset()
234-
resetSeed = phase.seed
235-
}
232+
// if resetSeed != phase.seed {
233+
// links.reset()
234+
// resetSeed = phase.seed
235+
// }
236236
var (container, containerChanged) = $container.changedValue()
237237
let linkChanged = withUnsafeMutablePointer(to: &container) {
238238
links.update(container: $0, phase: phase)

Sources/OpenSwiftUI/View/Modifier/AppearanceActionModifier.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ extension AppearanceEffect: StatefulRule {
8484
node.attribute = .current
8585
}
8686

87-
if phase.seed != resetSeed {
88-
resetSeed = phase.seed
89-
disappeared()
90-
}
87+
// if phase.seed != resetSeed {
88+
// resetSeed = phase.seed
89+
// disappeared()
90+
// }
9191
lastValue = modifier
9292
appeared()
9393
#else

Sources/OpenSwiftUI/Data/Environment/CachedEnvironment.swift renamed to Sources/OpenSwiftUICore/Data/Environment/CachedEnvironment.swift

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,28 @@
77
// ID: C424ABD9FC88B2DFD0B7B2319F2E7987
88

99
import Foundation
10-
internal import OpenGraphShims
11-
@_spi(ForOpenSwiftUIOnly) import OpenSwiftUICore
10+
package import OpenGraphShims
1211

13-
struct CachedEnvironment {
14-
var environment: Attribute<EnvironmentValues>
12+
package struct CachedEnvironment {
13+
package var environment: Attribute<EnvironmentValues>
1514
private var items: [Item]
1615
#if canImport(Darwin)
1716
private var constants: [HashableConstant: AnyAttribute]
1817
#endif
19-
private var animatedFrame: AnimatedFrame?
18+
// private var animatedFrame: AnimatedFrame?
2019
// private var resolvedFgStyles: [ResolvedFgStyle : Swift<_ShapeStyle_Resolved.ResolvedFg>]
2120

22-
init(_ environment: Attribute<EnvironmentValues>) {
21+
package init(_ environment: Attribute<EnvironmentValues>) {
2322
self.environment = environment
2423
items = []
2524
#if canImport(Darwin)
2625
constants = [:]
2726
#endif
28-
animatedFrame = nil
27+
// animatedFrame = nil
2928
// resolvedFgStyles = [:]
3029
}
3130

32-
mutating func attribute<Value>(keyPath: KeyPath<EnvironmentValues, Value>) -> Attribute<Value> {
31+
package mutating func attribute<Value>(keyPath: KeyPath<EnvironmentValues, Value>) -> Attribute<Value> {
3332
#if canImport(Darwin)
3433
if let item = items.first(where: { $0.key == keyPath }) {
3534
return Attribute(identifier: item.value)
@@ -43,7 +42,7 @@ struct CachedEnvironment {
4342
#endif
4443
}
4544

46-
mutating func intern<Value>(_ value: Value, id: Int) -> Attribute<Value> {
45+
package mutating func intern<Value>(_ value: Value, id: Int) -> Attribute<Value> {
4746
#if canImport(Darwin)
4847
let constant = HashableConstant(value, id: id)
4948
if let identifier = constants[constant] {
@@ -58,13 +57,13 @@ struct CachedEnvironment {
5857
#endif
5958
}
6059

61-
func animatePosition(for inputs: _ViewInputs) -> Attribute<ViewOrigin> {
62-
fatalError("TODO")
63-
}
64-
65-
func animateSize(for inputs: _ViewInputs) -> Attribute<ViewSize> {
66-
fatalError("TODO")
67-
}
60+
// func animatePosition(for inputs: _ViewInputs) -> Attribute<ViewOrigin> {
61+
// fatalError("TODO")
62+
// }
63+
//
64+
// func animateSize(for inputs: _ViewInputs) -> Attribute<ViewSize> {
65+
// fatalError("TODO")
66+
// }
6867

6968
// func resolvedForegroundStyle() {}
7069
}
@@ -119,40 +118,40 @@ private struct HashableConstant: Hashable {
119118
}
120119
}
121120

122-
private struct AnimatedFrame {
123-
let position: Attribute<ViewOrigin>
124-
let size: Attribute<ViewSize>
125-
let pixelLength: Attribute<CGFloat>
126-
let time: Attribute<Time>
127-
let transaction: Attribute<Transaction>
128-
let viewPhase: Attribute<_GraphInputs.Phase>
129-
let animatedFrame: Attribute<ViewFrame>
130-
private var _animatedPosition: Attribute<ViewOrigin>?
131-
private var _animatedSize: Attribute<ViewSize>?
132-
133-
mutating func animatePosition() -> Attribute<ViewOrigin> {
134-
guard let _animatedPosition else {
135-
// FIXME
136-
let animatePosition = animatedFrame.unsafeOffset(
137-
at: 0,
138-
as:ViewOrigin.self
139-
)
140-
_animatedPosition = animatePosition
141-
return animatePosition
142-
}
143-
return _animatedPosition
144-
}
145-
146-
mutating func animateSize() -> Attribute<ViewSize> {
147-
guard let _animatedSize else {
148-
// FIXME
149-
let animatedSize = animatedFrame.unsafeOffset(
150-
at: MemoryLayout<ViewOrigin>.size,
151-
as: ViewSize.self
152-
)
153-
_animatedSize = animatedSize
154-
return animatedSize
155-
}
156-
return _animatedSize
157-
}
158-
}
121+
//private struct AnimatedFrame {
122+
// let position: Attribute<ViewOrigin>
123+
// let size: Attribute<ViewSize>
124+
// let pixelLength: Attribute<CGFloat>
125+
// let time: Attribute<Time>
126+
// let transaction: Attribute<Transaction>
127+
// let viewPhase: Attribute<_GraphInputs.Phase>
128+
// let animatedFrame: Attribute<ViewFrame>
129+
// private var _animatedPosition: Attribute<ViewOrigin>?
130+
// private var _animatedSize: Attribute<ViewSize>?
131+
//
132+
// mutating func animatePosition() -> Attribute<ViewOrigin> {
133+
// guard let _animatedPosition else {
134+
// // FIXME
135+
// let animatePosition = animatedFrame.unsafeOffset(
136+
// at: 0,
137+
// as:ViewOrigin.self
138+
// )
139+
// _animatedPosition = animatePosition
140+
// return animatePosition
141+
// }
142+
// return _animatedPosition
143+
// }
144+
//
145+
// mutating func animateSize() -> Attribute<ViewSize> {
146+
// guard let _animatedSize else {
147+
// // FIXME
148+
// let animatedSize = animatedFrame.unsafeOffset(
149+
// at: MemoryLayout<ViewOrigin>.size,
150+
// as: ViewSize.self
151+
// )
152+
// _animatedSize = animatedSize
153+
// return animatedSize
154+
// }
155+
// return _animatedSize
156+
// }
157+
//}

Sources/OpenSwiftUICore/Data/Environment/EnvironmentKey.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ extension EnvironmentKey where Value: Equatable {
3030
}
3131
}
3232
#endif
33+
34+
package protocol DerivedEnvironmentKey {
35+
associatedtype Value: Equatable
36+
static func value(in: EnvironmentValues) -> Value
37+
}

0 commit comments

Comments
 (0)