Last active
May 19, 2017 13:17
-
-
Save bjhomer/3e5f1ebe4b3da14d489f3fe7903abdf0 to your computer and use it in GitHub Desktop.
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 Foundation | |
enum Foo: Error { | |
case dogAteHomework | |
} | |
func makesAnError(_ error: NSErrorPointer) { | |
autoreleasepool { | |
error?.pointee = Foo.dogAteHomework as NSError | |
} | |
} | |
var err: NSError? = nil | |
makesAnError(&err) // EXC_BAD_ACCESS in objc_retain | |
print(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The best fix I've found so far: