So this is a weird one.
I'm building a network SDK in Xcode 11.1, using CocoaPods and a few dependencies, like Alamofire. In writing my tests I need to cast from the
Error value coming out of my network calls to
AFError, returned by Alamofire. However, no attempt at such a cast is succeeding, despite having done the same cast hundreds of times in the past, including in Alamofire's tests. In my desperation I remember that I originally had CocoaPods set up to integrate my dependencies statically. I switched them to use dynamic frameworks and suddenly the casts work and my tests pass! Can anyone explain this behavior?
Additionally, Xcode 11's debugger was extremely broken here. Any attempt to print the result of a cast, like
error as? AFError would result in a debugger error:
error: Couldn't materialize: can't get size of type
error: errored out in DoExecute, couldn't PrepareToExecuteJITExpression
This debugger error is happening for many Alamofire types, not just
AFError, making debugging the library very frustrating. Any suggestions here?