Skip to content

Commit

Permalink
skip label for first parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
li-feng-sc committed Jul 12, 2024
1 parent bcf8b1c commit f98a415
Show file tree
Hide file tree
Showing 54 changed files with 234 additions and 226 deletions.
5 changes: 3 additions & 2 deletions examples/generated-src/swift/ItemList+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// This file was generated by Djinni from example.djinni

import DjinniSupport
import Foundation
import DjinniSupportCxx
import Foundation
import TextSort
import TextSortCxx

enum ItemListMarshaller: DjinniSupport.Marshaller {
typealias SwiftType = ItemList
typealias SwiftType = TextSort.ItemList
static func fromCpp(_ c: djinni.swift.AnyValue) -> SwiftType {
return withUnsafePointer(to: c) { p in
let items = ListMarshaller<StringMarshaller>.fromCpp(djinni.swift.getMember(p, 0))
Expand Down
10 changes: 5 additions & 5 deletions examples/generated-src/swift/SortItems+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import Foundation
import TextSort
import TextSortCxx

final class SortItemsCppProxy: DjinniSupport.CppProxy, SortItems {
final class SortItemsCppProxy: DjinniSupport.CppProxy, TextSort.SortItems {
init(_ inst: djinni.swift.AnyValue) { super.init(inst:inst) }
func sort(order: TextSort.SortOrder, items: TextSort.ItemList) throws -> Void {
func sort(_ order: TextSort.SortOrder, items: TextSort.ItemList) throws -> Void {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(SortOrderMarshaller.toCpp(order))
Expand All @@ -19,7 +19,7 @@ final class SortItemsCppProxy: DjinniSupport.CppProxy, SortItems {
}
}
enum SortItemsMarshaller: DjinniSupport.Marshaller {
typealias SwiftType = SortItems
typealias SwiftType = TextSort.SortItems
static func fromCpp(_ c: djinni.swift.AnyValue) -> SwiftType {
return cppInterfaceToSwift(c, { SortItemsCppProxy(c) as SwiftType })
}
Expand All @@ -28,14 +28,14 @@ enum SortItemsMarshaller: DjinniSupport.Marshaller {
}
}
public class SortItems_statics {
static func createWithListener(listener: TextSort.TextboxListener) throws -> TextSort.SortItems {
static func createWithListener(_ listener: TextSort.TextboxListener) throws -> TextSort.SortItems {
var params = djinni.swift.ParameterList()
params.addValue(TextboxListenerMarshaller.toCpp(listener))
var ret = djinni_generated.SortItems_createWithListener(&params)
try handleCppErrors(&ret)
return SortItemsMarshaller.fromCpp(ret)
}
static func runSort(items: TextSort.ItemList) throws -> TextSort.ItemList {
static func runSort(_ items: TextSort.ItemList) throws -> TextSort.ItemList {
var params = djinni.swift.ParameterList()
params.addValue(ItemListMarshaller.toCpp(items))
var ret = djinni_generated.SortItems_runSort(&params)
Expand Down
2 changes: 1 addition & 1 deletion examples/generated-src/swift/SortItems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import Foundation

public protocol SortItems: AnyObject {
/** For the iOS / Android demo */
func sort(order: TextSort.SortOrder, items: TextSort.ItemList) throws -> Void
func sort(_ order: TextSort.SortOrder, items: TextSort.ItemList) throws -> Void
}
4 changes: 2 additions & 2 deletions examples/generated-src/swift/TextboxListener+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import TextSortCxx
let textboxListenerMethods: Vtbl<TextboxListener> = [
{ inst, params, ret in
let _items = ItemListMarshaller.fromCpp(djinni.swift.getMember(params, 0))
try inst.update(items: _items)
try inst.update(_items)
},
]

enum TextboxListenerMarshaller: DjinniSupport.Marshaller {
typealias SwiftType = TextboxListener
typealias SwiftType = TextSort.TextboxListener
static func fromCpp(_ c: djinni.swift.AnyValue) -> SwiftType {
return cppInterfaceToSwift(c, { fatalError("n/a") })
}
Expand Down
2 changes: 1 addition & 1 deletion examples/generated-src/swift/TextboxListener.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
import Foundation

public protocol TextboxListener: AnyObject {
func update(items: TextSort.ItemList) throws -> Void
func update(_ items: TextSort.ItemList) throws -> Void
}
9 changes: 8 additions & 1 deletion src/source/SwiftGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ class SwiftGenerator(spec: Spec) extends Generator(spec) {
for (m <- i.methods.filter(!_.static)) {
writeMethodDoc(w, m, idSwift.local)
w.w(s"func ${swiftMethodName(m.ident)}(")
// skip label for the first parameter
if (m.params.nonEmpty) { w.w("_ ") }
w.w(m.params.map(p => s"${idSwift.local(p.ident)}: ${marshal.fqParamType(p.ty)}").mkString(", "))
w.wl(s") throws -> ${marshal.fqReturnType(m.ret)}")
}
Expand All @@ -253,6 +255,7 @@ class SwiftGenerator(spec: Spec) extends Generator(spec) {
w.wl("init(_ inst: djinni.swift.AnyValue) { super.init(inst:inst) } ")
for (m <- i.methods.filter(!_.static)) {
w.w(s"func ${swiftMethodName(m.ident)}(")
if (m.params.nonEmpty) { w.w("_ ") }
w.w(m.params.map(p => s"${idSwift.local(p.ident)}: ${marshal.fqParamType(p.ty)}").mkString(", "))
w.w(s") throws -> ${marshal.fqReturnType(m.ret)}").braced {
w.wl("var params = djinni.swift.ParameterList()")
Expand Down Expand Up @@ -280,7 +283,10 @@ class SwiftGenerator(spec: Spec) extends Generator(spec) {
val pi = s"djinni.swift.getMember(params, $i)"
w.wl(s"let _${idSwift.local(p.ident)} = ${marshal.fromCpp(p.ty, pi)}")
}
val args = m.params.map(p => s"${idSwift.local(p.ident)}: _${idSwift.local(p.ident)}").mkString(", ")
val args = m.params.view.zipWithIndex.map{case (p, i) =>
val label = if (i==0) "" else s"${idSwift.local(p.ident)}: "
label + s"_${idSwift.local(p.ident)}"
}.mkString(", ")
val call = s"inst.${swiftMethodName(m.ident)}(${args})"
if (m.ret.isEmpty) {
w.wl("try " + call)
Expand Down Expand Up @@ -312,6 +318,7 @@ class SwiftGenerator(spec: Spec) extends Generator(spec) {
w.w(s"public class ${marshal.typename(ident, i)}_statics").braced {
for (m <- staticMethods) {
w.w(s"static func ${swiftMethodName(m.ident)}(")
if (m.params.nonEmpty) { w.w("_ ") }
w.w(m.params.map(p => s"${idSwift.local(p.ident)}: ${marshal.fqParamType(p.ty)}").mkString(", "))
w.w(s") throws -> ${marshal.fqReturnType(m.ret)}").braced {
w.wl("var params = djinni.swift.ParameterList()")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TestSuiteCxx
let asyncInterfaceMethods: Vtbl<AsyncInterface> = [
{ inst, params, ret in
let _f = FutureMarshaller<I32Marshaller>.fromCpp(djinni.swift.getMember(params, 0))
djinni.swift.setReturnValue(ret, try FutureMarshaller<StringMarshaller>.toCpp(inst.futureRoundtrip(f: _f)))
djinni.swift.setReturnValue(ret, try FutureMarshaller<StringMarshaller>.toCpp(inst.futureRoundtrip(_f)))
},
]

Expand Down
2 changes: 1 addition & 1 deletion test-suite/generated-src/swift/AsyncInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import DjinniSupport
import Foundation

public protocol AsyncInterface: AnyObject {
func futureRoundtrip(f: DJFuture<Int32>) throws -> DJFuture<String>
func futureRoundtrip(_ f: DJFuture<Int32>) throws -> DJFuture<String>
}
8 changes: 4 additions & 4 deletions test-suite/generated-src/swift/ClientInterface+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ let clientInterfaceMethods: Vtbl<ClientInterface> = [
let _recordId = I64Marshaller.fromCpp(djinni.swift.getMember(params, 0))
let _utf8string = StringMarshaller.fromCpp(djinni.swift.getMember(params, 1))
let _misc = OptionalMarshaller<StringMarshaller>.fromCpp(djinni.swift.getMember(params, 2))
djinni.swift.setReturnValue(ret, try ClientReturnedRecordMarshaller.toCpp(inst.getRecord(recordId: _recordId, utf8string: _utf8string, misc: _misc)))
djinni.swift.setReturnValue(ret, try ClientReturnedRecordMarshaller.toCpp(inst.getRecord(_recordId, utf8string: _utf8string, misc: _misc)))
},
{ inst, params, ret in
let _data = BinaryMarshaller.fromCpp(djinni.swift.getMember(params, 0))
let _r = I32Marshaller.fromCpp(djinni.swift.getMember(params, 1))
let _jret = I64Marshaller.fromCpp(djinni.swift.getMember(params, 2))
djinni.swift.setReturnValue(ret, try F64Marshaller.toCpp(inst.identifierCheck(data: _data, r: _r, jret: _jret)))
djinni.swift.setReturnValue(ret, try F64Marshaller.toCpp(inst.identifierCheck(_data, r: _r, jret: _jret)))
},
{ inst, params, ret in
djinni.swift.setReturnValue(ret, try StringMarshaller.toCpp(inst.returnStr()))
},
{ inst, params, ret in
let _i = ClientInterfaceMarshaller.fromCpp(djinni.swift.getMember(params, 0))
djinni.swift.setReturnValue(ret, try StringMarshaller.toCpp(inst.methTakingInterface(i: _i)))
djinni.swift.setReturnValue(ret, try StringMarshaller.toCpp(inst.methTakingInterface(_i)))
},
{ inst, params, ret in
let _i = OptionalMarshaller<ClientInterfaceMarshaller>.fromCpp(djinni.swift.getMember(params, 0))
djinni.swift.setReturnValue(ret, try StringMarshaller.toCpp(inst.methTakingOptionalInterface(i: _i)))
djinni.swift.setReturnValue(ret, try StringMarshaller.toCpp(inst.methTakingOptionalInterface(_i)))
},
]

Expand Down
8 changes: 4 additions & 4 deletions test-suite/generated-src/swift/ClientInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Foundation
/** Client interface */
public protocol ClientInterface: AnyObject {
/** Returns record of given string */
func getRecord(recordId: Int64, utf8string: String, misc: Optional<String>) throws -> TestSuite.ClientReturnedRecord
func identifierCheck(data: Data, r: Int32, jret: Int64) throws -> Double
func getRecord(_ recordId: Int64, utf8string: String, misc: Optional<String>) throws -> TestSuite.ClientReturnedRecord
func identifierCheck(_ data: Data, r: Int32, jret: Int64) throws -> Double
func returnStr() throws -> String
func methTakingInterface(i: TestSuite.ClientInterface) throws -> String
func methTakingOptionalInterface(i: Optional<TestSuite.ClientInterface>) throws -> String
func methTakingInterface(_ i: TestSuite.ClientInterface) throws -> String
func methTakingOptionalInterface(_ i: Optional<TestSuite.ClientInterface>) throws -> String
}
2 changes: 1 addition & 1 deletion test-suite/generated-src/swift/ConflictUser+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ConflictUserCppProxy: DjinniSupport.CppProxy, TestSuite.ConflictUser
try handleCppErrors(&ret)
return ConflictMarshaller.fromCpp(ret)
}
func conflictArg(cs: Array<TestSuite.Conflict>) throws -> Bool {
func conflictArg(_ cs: Array<TestSuite.Conflict>) throws -> Bool {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ListMarshaller<ConflictMarshaller>.toCpp(cs))
Expand Down
2 changes: 1 addition & 1 deletion test-suite/generated-src/swift/ConflictUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import Foundation

public protocol ConflictUser: AnyObject {
func Conflict() throws -> TestSuite.Conflict
func conflictArg(cs: Array<TestSuite.Conflict>) throws -> Bool
func conflictArg(_ cs: Array<TestSuite.Conflict>) throws -> Bool
}
4 changes: 2 additions & 2 deletions test-suite/generated-src/swift/CppException+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ final class CppExceptionCppProxy: DjinniSupport.CppProxy, TestSuite.CppException
try handleCppErrors(&ret)
return I32Marshaller.fromCpp(ret)
}
func callThrowingInterface(cb: TestSuite.ThrowingInterface) throws -> Int32 {
func callThrowingInterface(_ cb: TestSuite.ThrowingInterface) throws -> Int32 {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ThrowingInterfaceMarshaller.toCpp(cb))
var ret = djinni_generated.CppException_callThrowingInterface(&params)
try handleCppErrors(&ret)
return I32Marshaller.fromCpp(ret)
}
func callThrowingAndCatch(cb: TestSuite.ThrowingInterface) throws -> String {
func callThrowingAndCatch(_ cb: TestSuite.ThrowingInterface) throws -> String {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ThrowingInterfaceMarshaller.toCpp(cb))
Expand Down
4 changes: 2 additions & 2 deletions test-suite/generated-src/swift/CppException.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import Foundation

public protocol CppException: AnyObject {
func throwAnException() throws -> Int32
func callThrowingInterface(cb: TestSuite.ThrowingInterface) throws -> Int32
func callThrowingAndCatch(cb: TestSuite.ThrowingInterface) throws -> String
func callThrowingInterface(_ cb: TestSuite.ThrowingInterface) throws -> Int32
func callThrowingAndCatch(_ cb: TestSuite.ThrowingInterface) throws -> String
}
6 changes: 3 additions & 3 deletions test-suite/generated-src/swift/DataRefTest+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TestSuiteCxx

final class DataRefTestCppProxy: DjinniSupport.CppProxy, TestSuite.DataRefTest {
init(_ inst: djinni.swift.AnyValue) { super.init(inst:inst) }
func sendData(data: NSData) throws -> Void {
func sendData(_ data: NSData) throws -> Void {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(DataRefMarshaller.toCpp(data))
Expand All @@ -23,7 +23,7 @@ final class DataRefTestCppProxy: DjinniSupport.CppProxy, TestSuite.DataRefTest {
try handleCppErrors(&ret)
return BinaryMarshaller.fromCpp(ret)
}
func sendMutableData(data: NSData) throws -> Void {
func sendMutableData(_ data: NSData) throws -> Void {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(DataRefMarshaller.toCpp(data))
Expand Down Expand Up @@ -51,7 +51,7 @@ final class DataRefTestCppProxy: DjinniSupport.CppProxy, TestSuite.DataRefTest {
try handleCppErrors(&ret)
return DataRefMarshaller.fromCpp(ret)
}
func sendDataView(data: NSData) throws -> Data {
func sendDataView(_ data: NSData) throws -> Data {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(DataViewMarshaller.toCpp(data))
Expand Down
6 changes: 3 additions & 3 deletions test-suite/generated-src/swift/DataRefTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import Foundation

public protocol DataRefTest: AnyObject {
func sendData(data: NSData) throws -> Void
func sendData(_ data: NSData) throws -> Void
func retriveAsBin() throws -> Data
func sendMutableData(data: NSData) throws -> Void
func sendMutableData(_ data: NSData) throws -> Void
func generateData() throws -> NSData
func dataFromVec() throws -> NSData
func dataFromStr() throws -> NSData
func sendDataView(data: NSData) throws -> Data
func sendDataView(_ data: NSData) throws -> Data
func recvDataView() throws -> NSData
}
10 changes: 5 additions & 5 deletions test-suite/generated-src/swift/EnumUsageInterface+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@ import TestSuiteCxx

final class EnumUsageInterfaceCppProxy: DjinniSupport.CppProxy, TestSuite.EnumUsageInterface {
init(_ inst: djinni.swift.AnyValue) { super.init(inst:inst) }
func e(e: TestSuite.Color) throws -> TestSuite.Color {
func e(_ e: TestSuite.Color) throws -> TestSuite.Color {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ColorMarshaller.toCpp(e))
var ret = djinni_generated.EnumUsageInterface_e(&params)
try handleCppErrors(&ret)
return ColorMarshaller.fromCpp(ret)
}
func o(o: Optional<TestSuite.Color>) throws -> Optional<TestSuite.Color> {
func o(_ o: Optional<TestSuite.Color>) throws -> Optional<TestSuite.Color> {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(OptionalMarshaller<ColorMarshaller>.toCpp(o))
var ret = djinni_generated.EnumUsageInterface_o(&params)
try handleCppErrors(&ret)
return OptionalMarshaller<ColorMarshaller>.fromCpp(ret)
}
func l(l: Array<TestSuite.Color>) throws -> Array<TestSuite.Color> {
func l(_ l: Array<TestSuite.Color>) throws -> Array<TestSuite.Color> {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ListMarshaller<ColorMarshaller>.toCpp(l))
var ret = djinni_generated.EnumUsageInterface_l(&params)
try handleCppErrors(&ret)
return ListMarshaller<ColorMarshaller>.fromCpp(ret)
}
func s(s: Set<TestSuite.Color>) throws -> Set<TestSuite.Color> {
func s(_ s: Set<TestSuite.Color>) throws -> Set<TestSuite.Color> {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(SetMarshaller<ColorMarshaller>.toCpp(s))
var ret = djinni_generated.EnumUsageInterface_s(&params)
try handleCppErrors(&ret)
return SetMarshaller<ColorMarshaller>.fromCpp(ret)
}
func m(m: Dictionary<TestSuite.Color, TestSuite.Color>) throws -> Dictionary<TestSuite.Color, TestSuite.Color> {
func m(_ m: Dictionary<TestSuite.Color, TestSuite.Color>) throws -> Dictionary<TestSuite.Color, TestSuite.Color> {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(MapMarshaller<ColorMarshaller, ColorMarshaller>.toCpp(m))
Expand Down
10 changes: 5 additions & 5 deletions test-suite/generated-src/swift/EnumUsageInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import Foundation

public protocol EnumUsageInterface: AnyObject {
func e(e: TestSuite.Color) throws -> TestSuite.Color
func o(o: Optional<TestSuite.Color>) throws -> Optional<TestSuite.Color>
func l(l: Array<TestSuite.Color>) throws -> Array<TestSuite.Color>
func s(s: Set<TestSuite.Color>) throws -> Set<TestSuite.Color>
func m(m: Dictionary<TestSuite.Color, TestSuite.Color>) throws -> Dictionary<TestSuite.Color, TestSuite.Color>
func e(_ e: TestSuite.Color) throws -> TestSuite.Color
func o(_ o: Optional<TestSuite.Color>) throws -> Optional<TestSuite.Color>
func l(_ l: Array<TestSuite.Color>) throws -> Array<TestSuite.Color>
func s(_ s: Set<TestSuite.Color>) throws -> Set<TestSuite.Color>
func m(_ m: Dictionary<TestSuite.Color, TestSuite.Color>) throws -> Dictionary<TestSuite.Color, TestSuite.Color>
}
4 changes: 2 additions & 2 deletions test-suite/generated-src/swift/ExternInterface1+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import TestSuiteCxx

final class ExternInterface1CppProxy: DjinniSupport.CppProxy, TestSuite.ExternInterface1 {
init(_ inst: djinni.swift.AnyValue) { super.init(inst:inst) }
func foo(i: ClientInterface) throws -> ClientReturnedRecord {
func foo(_ i: ClientInterface) throws -> ClientReturnedRecord {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ClientInterfaceMarshaller.toCpp(i))
var ret = djinni_generated.ExternInterface1_foo(&params)
try handleCppErrors(&ret)
return ClientReturnedRecordMarshaller.fromCpp(ret)
}
func bar(e: Color) throws -> Color {
func bar(_ e: Color) throws -> Color {
var params = djinni.swift.ParameterList()
params.addValue(inst)
params.addValue(ColorMarshaller.toCpp(e))
Expand Down
4 changes: 2 additions & 2 deletions test-suite/generated-src/swift/ExternInterface1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import Foundation

public protocol ExternInterface1: AnyObject {
func foo(i: ClientInterface) throws -> ClientReturnedRecord
func bar(e: Color) throws -> Color
func foo(_ i: ClientInterface) throws -> ClientReturnedRecord
func bar(_ e: Color) throws -> Color
}
2 changes: 1 addition & 1 deletion test-suite/generated-src/swift/ExternInterface2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
import Foundation

public protocol ExternInterface2: AnyObject {
func foo(i: TestHelpers) throws -> TestSuite.ExternRecordWithDerivings
func foo(_ i: TestHelpers) throws -> TestSuite.ExternRecordWithDerivings
}
8 changes: 4 additions & 4 deletions test-suite/generated-src/swift/FlagRoundtrip+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ enum FlagRoundtripMarshaller: DjinniSupport.Marshaller {
}
}
public class FlagRoundtrip_statics {
static func roundtripAccess(flag: TestSuite.AccessFlags) throws -> TestSuite.AccessFlags {
static func roundtripAccess(_ flag: TestSuite.AccessFlags) throws -> TestSuite.AccessFlags {
var params = djinni.swift.ParameterList()
params.addValue(AccessFlagsMarshaller.toCpp(flag))
var ret = djinni_generated.FlagRoundtrip_roundtripAccess(&params)
try handleCppErrors(&ret)
return AccessFlagsMarshaller.fromCpp(ret)
}
static func roundtripEmpty(flag: TestSuite.EmptyFlags) throws -> TestSuite.EmptyFlags {
static func roundtripEmpty(_ flag: TestSuite.EmptyFlags) throws -> TestSuite.EmptyFlags {
var params = djinni.swift.ParameterList()
params.addValue(EmptyFlagsMarshaller.toCpp(flag))
var ret = djinni_generated.FlagRoundtrip_roundtripEmpty(&params)
try handleCppErrors(&ret)
return EmptyFlagsMarshaller.fromCpp(ret)
}
static func roundtripAccessBoxed(flag: Optional<TestSuite.AccessFlags>) throws -> Optional<TestSuite.AccessFlags> {
static func roundtripAccessBoxed(_ flag: Optional<TestSuite.AccessFlags>) throws -> Optional<TestSuite.AccessFlags> {
var params = djinni.swift.ParameterList()
params.addValue(OptionalMarshaller<AccessFlagsMarshaller>.toCpp(flag))
var ret = djinni_generated.FlagRoundtrip_roundtripAccessBoxed(&params)
try handleCppErrors(&ret)
return OptionalMarshaller<AccessFlagsMarshaller>.fromCpp(ret)
}
static func roundtripEmptyBoxed(flag: Optional<TestSuite.EmptyFlags>) throws -> Optional<TestSuite.EmptyFlags> {
static func roundtripEmptyBoxed(_ flag: Optional<TestSuite.EmptyFlags>) throws -> Optional<TestSuite.EmptyFlags> {
var params = djinni.swift.ParameterList()
params.addValue(OptionalMarshaller<EmptyFlagsMarshaller>.toCpp(flag))
var ret = djinni_generated.FlagRoundtrip_roundtripEmptyBoxed(&params)
Expand Down
Loading

0 comments on commit f98a415

Please sign in to comment.