From 4723f73fa31483e954ffcd65b11dcd8c740efd16 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 4 Mar 2019 14:29:40 +0100 Subject: Fix sequence and dictionary type alias for nested definitions --- cpp/src/slice2swift/Gen.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cpp/src/slice2swift/Gen.cpp') 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) << "]"; } -- cgit v1.2.3