Swift Mapping for Operations on Local Types
An operation on a local interface or a local class is mapped to a Swift instance method with the same name. The mapping of operation parameters to Swift is identical to the Client-Side Mapping for these parameters.
Unlike the Client-Side mapping, there is trailing Context parameter in these methods.
For example:
Slice
module M { local interface L; // forward declared local sequence<L> LSeq; local interface L { string op(int n, string s, LocalObject any, out int m, out string t, out LSeq newLSeq); } }
is mapped to:
Swift
public typealias LSeq = [L?] public protocol L: AnyObject { func op(n: Int32, s: String, any: AnyObject?) throws -> (returnValue: String, m: Int32, t: String, newLSeq: LSeq) }