Closed
Description
Hitting this compile error when trying to support the throws
annotation:
pkgs/swift2objc/test/integration/throws_output.swift:16:21: error: throwing method cannot be marked @objc because it returns a value of type 'Int'; return 'Void' or a type that bridges to an Objective-C class
@objc public func intMethod(y: Int) throws -> Int {
Looks like functions and methods that return primitive types can't be marked both @objc
and throws
. This is similar to #1743. The fix in both cases is to return a boxed primitive.
Metadata
Metadata
Assignees
Type
Projects
Status
Done