Created
October 20, 2016 19:34
-
-
Save smic/5d45dcaf77b902110d74eaeb2e54dcc8 to your computer and use it in GitHub Desktop.
Mysterious Bad Access
This file contains hidden or 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 Cocoa | |
public func with<T>(_ item: T, update: (inout T) throws -> Void) rethrows -> T { | |
var this = item; try update(&this); return this | |
} | |
let path = with(CGMutablePath()) { // <--- Bad Access | |
$0.move(to: CGPoint(x: 0, y: 0)) | |
$0.addLine(to: CGPoint(x: 100, y: 100)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment