summaryrefslogtreecommitdiff
path: root/cpp/src/slice2swift/Gen.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2019-05-03 16:25:38 -0400
committerBernard Normier <bernard@zeroc.com>2019-05-03 16:25:38 -0400
commitc50c2eaf5d7dabf17b5bc9ca4dd72cd5b590661b (patch)
treed9522e2e7b697ca6738431d7bc242830d6328e44 /cpp/src/slice2swift/Gen.cpp
parentIce/hold test fixes (diff)
downloadice-c50c2eaf5d7dabf17b5bc9ca4dd72cd5b590661b.tar.bz2
ice-c50c2eaf5d7dabf17b5bc9ca4dd72cd5b590661b.tar.xz
ice-c50c2eaf5d7dabf17b5bc9ca4dd72cd5b590661b.zip
Changed mapping for sequence<byte> to Foundation.Data
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r--cpp/src/slice2swift/Gen.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp
index a1e79ac6bf7..d64a6626613 100644
--- a/cpp/src/slice2swift/Gen.cpp
+++ b/cpp/src/slice2swift/Gen.cpp
@@ -599,17 +599,25 @@ Gen::TypesVisitor::visitSequence(const SequencePtr& p)
int typeCtx = p->isLocal() ? TypeContextLocal : 0;
const TypePtr type = p->type();
+ BuiltinPtr builtin = BuiltinPtr::dynamicCast(p->type());
out << sp;
- out << nl << "public typealias " << name << " = [" << typeToString(p->type(), p, p->getMetaData(), false, typeCtx)
- << "]";
+ out << nl << "public typealias " << name << " = ";
+
+ if(builtin && builtin->kind() == Builtin::KindByte)
+ {
+ out << "Foundation.Data";
+ }
+ else
+ {
+ out << "[" << typeToString(p->type(), p, p->getMetaData(), false, typeCtx) << "]";
+ }
if(p->isLocal())
{
return;
}
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(p->type());
if(builtin && builtin->kind() <= Builtin::KindString)
{
return; // No helpers for sequence of primitive types