Xcode Error: SwiftPM - Value of type '(@escaping (Result<T, ErrorType>) -> Void) -> Void' has no member 'dematerialize'

Was attempting to build with my signing cert and ran in to a swift compile error. On macOS 12.3.1 - M1 - Xcode 13.3.1

SwiftPM - Sources - Basic - Await.swift - await

Line 18:

Value of type '(@escaping (Result<T, ErrorType>) -> Void) -> Void' has no member 'dematerialize'

code block referenced:

public func await<T, ErrorType>(_ body: (@escaping (Result<T, ErrorType>) -> Void) -> Void) throws -> T {
    return try await(body).dematerialize()
}

Any clues on how to resolve this?

You're probably conflicting with the await keyword introduced in Swift 5.5. You should try renaming that function.

In the future you'll want to be more clear about what you're building. Is this your code, is it a dependency?

1 Like

Yeah, also this looks like it's going to call itself infinitely and dematerialize the world!

Thanks for your input. It's a dependency. The app is building SwiftPM and generating this error.

Looks like that dependency is way out of date then, as SPM doesn't even have that code anymore. You'll probably want to update your checkout, or however you're integrating SPM. Alternatively, try using Xcode 12.5.1.