Skip to content

Instantly share code, notes, and snippets.

@tjw
Created September 23, 2016 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjw/ebdd2d9da6ee2ea413a22c469132802c to your computer and use it in GitHub Desktop.
Save tjw/ebdd2d9da6ee2ea413a22c469132802c to your computer and use it in GitHub Desktop.
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