Created
July 1, 2019 19:08
-
-
Save JRHeaton/24837ac112d8bf6c1e35f19e43df0a6d to your computer and use it in GitHub Desktop.
Issue causing segmentation fault (Xcode 10.2.1, Swift 4.2.1)
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
/* === This code segfaults, and only through much trial & error + commenting out code did I narrow it down to this. === */ | |
/* | |
protocol PaymentService { | |
typealias Error = Swift.Error & CustomStringConvertible & Equatable | |
associatedtype LogInError: PaymentService.Error | |
} | |
// MyPaymentService.LogInError does not conform to Swift.Error | |
*/ | |
/* === This code compiles fine. I believe this is a bug in the compiler (conforming to the typealias, | |
unless changed deliberately, should behave as in prior Swift versions where it's equivalent to | |
conforming directly as is done below. === */ | |
protocol PaymentService { | |
associatedtype LogInError: Swift.Error & CustomStringConvertible & Equatable | |
} | |
// MyPaymentService.LogInError DOES conform to Swift.Error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: The segfaulting code does compile and run on Xcode 10.1.