Skip to content

Generic parameter 'Result' could not be inferred #28

Answered by stephencelis
kgrigsby59 asked this question in Q&A
Discussion options

You must be logged in to vote

@kgrigsby59 XCTUnimplemented is meant as a dependency "generator" of sorts, so it's responsible for emitting a function that will fail when called later (as opposed to XCTFail, which fails immediately when called). I think you can do the following to get things building:

 extension SpotlightClient {
     public static let unimplemented = Self(
-        refreshSpotlightIndex: { XCTUnimplemented("\(Self.self).refreshSpotlightIndex") }
+        refreshSpotlightIndex: XCTUnimplemented("\(Self.self).refreshSpotlightIndex")
     )
 }

Basically, call XCTUnimplemented in place of the endpoint's closure, not within the endpoint's closure.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kgrigsby59
Comment options

Answer selected by kgrigsby59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants