Skip to content

Instantly share code, notes, and snippets.

@tomlokhorst
Created June 6, 2019 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomlokhorst/1dd230e22364f530067099b07570a395 to your computer and use it in GitHub Desktop.
Save tomlokhorst/1dd230e22364f530067099b07570a395 to your computer and use it in GitHub Desktop.
Xcode 11 iOS 12 crash: failed to demangle witness for associated type
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
print(process(MyFoo()))
return true
}
}
struct MyFoo: Foo {
var body: some Foo {
return Bar()
}
}
public func process<Out: Foo>(_ foo: Out) -> String {
print("hi")
return process(foo.body)
}
public protocol Foo {
associatedtype Body: Foo
var body: Body { get }
}
extension Never: Foo {
public var body: Never {
fatalError()
}
}
struct Bar: Foo {
typealias Body = Never
public var body: Self.Body {
fatalError()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment