Skip to content

Commit 5ddde54

Browse files
Merge pull request #95 from john-flanagan/jflan/crash-workaround
Work around String metatype bug
2 parents 838e614 + 911247f commit 5ddde54

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Sources/Inject/Integrations/SwiftUI.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public extension SwiftUI.View {
2626
public struct ObserveInjection: DynamicProperty {
2727
@ObservedObject private var iO = InjectConfiguration.observer
2828
public init() {}
29-
public private(set) var wrappedValue: InjectConfiguration.Type = InjectConfiguration.self
29+
// Use a computed property rather than directly storing the value to work around https://github.com/swiftlang/swift/issues/62003
30+
public var wrappedValue: InjectConfiguration.Type { InjectConfiguration.self }
3031
}
3132

3233
#else
@@ -45,7 +46,8 @@ public extension SwiftUI.View {
4546
@propertyWrapper @MainActor
4647
public struct ObserveInjection: DynamicProperty {
4748
public init() {}
48-
public private(set) var wrappedValue: InjectConfiguration.Type = InjectConfiguration.self
49+
// Use a computed property rather than directly storing the value to work around https://github.com/swiftlang/swift/issues/62003
50+
public var wrappedValue: InjectConfiguration.Type { InjectConfiguration.self }
4951
}
5052
#endif
5153
#endif

0 commit comments

Comments
 (0)