diff options
author | Jose <jose@zeroc.com> | 2019-03-04 14:29:40 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-03-04 14:29:40 +0100 |
commit | 4723f73fa31483e954ffcd65b11dcd8c740efd16 (patch) | |
tree | 2f62591c8f4b9b53110668c70a20b360a952b698 /cpp/src/slice2swift/Gen.cpp | |
parent | Enums test (diff) | |
download | ice-4723f73fa31483e954ffcd65b11dcd8c740efd16.tar.bz2 ice-4723f73fa31483e954ffcd65b11dcd8c740efd16.tar.xz ice-4723f73fa31483e954ffcd65b11dcd8c740efd16.zip |
Fix sequence and dictionary type alias for nested definitions
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r-- | cpp/src/slice2swift/Gen.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index b00cf98f846..7bfda21774e 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -420,23 +420,23 @@ Gen::TypesVisitor::visitStructStart(const StructPtr& p) void Gen::TypesVisitor::visitSequence(const SequencePtr& p) { - const string name = fixIdent(p->name()); - const TypePtr type = p->type(); + const string swiftModule = getSwiftModule(getTopLevelModule(ContainedPtr::dynamicCast(p))); + const string name = getUnqualified(getAbsolute(p), swiftModule); out << sp; - out << nl << "public typealias " << name << " = [" << typeToString(type, p) << "]"; + out << nl << "public typealias " << name << " = [" << typeToString(p->type(), p) << "]"; } void Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) { - const string name = fixIdent(p->name()); - - const TypePtr keyType = p->keyType(); - const TypePtr valueType = p->valueType(); + const string swiftModule = getSwiftModule(getTopLevelModule(ContainedPtr::dynamicCast(p))); + const string name = getUnqualified(getAbsolute(p), swiftModule); out << sp; - out << nl << "public typealias " << name << " = [" << typeToString(keyType, p) << ":" << typeToString(valueType, p) + out << nl << "public typealias " << name << " = [" + << typeToString(p->keyType(), p) << ":" + << typeToString(p->valueType(), p) << "]"; } |