From adec71218c1503663a371ea7cf30ea9068f95eb9 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 3 Apr 2019 15:08:27 +0200 Subject: Fixes for optional marshalling unmarshalling --- cpp/src/slice2swift/Gen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpp/src/slice2swift/Gen.cpp') diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index 51febc811c6..03b8b97bb0b 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -549,12 +549,14 @@ Gen::TypesVisitor::visitStructStart(const StructPtr& p) if(p->isVariableLength()) { out << nl << "let pos = startSize()"; + out << nl << "write(v)"; + out << nl << "endSize(position: pos)"; } else { out << nl << "write(size: " << p->minWireSize() << ")"; + out << nl << "write(v)"; } - out << nl << "write(v)"; out << eb; out << eb; out << eb; -- cgit v1.2.3