Created
June 6, 2019 14:55
-
-
Save tomlokhorst/1dd230e22364f530067099b07570a395 to your computer and use it in GitHub Desktop.
Xcode 11 iOS 12 crash: failed to demangle witness for associated type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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