File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
Sources/DependenciesMacros Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 111
111
/// and does not need to signify a real value. For example, if the endpoint returns a boolean, you
112
112
/// can return `false`, or if it returns an array, you can return `[]`.`
113
113
///
114
- /// > Warning: Due to a [bug in the Swift compiler](https://github.com/apple/swift/issues/71070),
115
- /// > endpoints that are not throwing will not emit a test failure when invoked. This applies to
116
- /// > dependencies with endpoints like this:
117
- /// >
118
- /// > ```swift
119
- /// > @DependencyClient
120
- /// > struct NumberFetcher {
121
- /// > var get: () async -> Int = { 42 }
122
- /// > }
123
- /// > ```
124
- /// >
125
- /// > The workaround is to invoke `XCTFail` directly in the closure:
126
- /// >
127
- /// > ```swift
128
- /// > @DependencyClient
129
- /// > struct NumberFetcher {
130
- /// > var get: () async -> Int = { XCTFail("\(Self.self).get"); return 42 }
131
- /// > }
132
- /// > ```
133
- ///
134
114
/// [designing-dependencies]: https://swiftpackageindex.com/pointfreeco/swift-dependencies/main/documentation/dependencies/designingdependencies
135
115
/// [separating-interface-implementation]: https://swiftpackageindex.com/pointfreeco/swift-dependencies/main/documentation/dependencies/livepreviewtest#Separating-interface-and-implementation
136
116
@attached ( member, names: named ( init) )
You can’t perform that action at this time.
0 commit comments