Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Foundation
/*
xcrun swift objc-throwing-block.swift
objc-throwing-block.swift:20:13: error: method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C
@objc func access(accessor: Accessor) {}
^
objc-throwing-block.swift:20:30: note: throwing function types cannot be represented in Objective-C
@objc func access(accessor: Accessor) {}
^~~~~~~~
*/
// I would expect this to get turned into something like `BOOL (^)(NSURL *, NSError **outError)
typealias Accessor = (URL) throws -> Void
@objc class Foo : NSObject {
@objc func access(accessor: Accessor) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment