bezierpath-length icon indicating copy to clipboard operation
bezierpath-length copied to clipboard

Compiler Error PathElement Line 61

Open rally-john opened this issue 5 years ago • 1 comments

https://github.com/louisdh/bezierpath-length/blob/b007af75ab55daabaf34c6e8d2081395730ec92b/Source/PathElement.swift#L61

self.apply(info: unsafeBitCast(applier, to: UnsafeMutableRawPointer.self), function: unsafeBitCast(callback, to: CGPathApplierFunction.self))

This code throws a compiler error: "Converting non-escaping value to 'T' may allow it to escape"

Any suggestions on how to resolve this?

Thanks!

rally-john avatar Oct 17 '19 21:10 rally-john

fileprivate func apply(with applier: PathApplier)

change it to

fileprivate func apply(with applier:@escaping PathApplier)

umerfarooqy avatar Jan 12 '21 10:01 umerfarooqy