summaryrefslogtreecommitdiff
path: root/cpp/src/slice2swift/Gen.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2019-03-11 11:17:09 -0400
committerJoe George <joe@zeroc.com>2019-03-11 11:45:13 -0400
commit21662dcec97bc2752f4b30e2ab23d3f29f65d535 (patch)
treea5e22fc99af8c6bddae77e7a4c1bceb81994ebe1 /cpp/src/slice2swift/Gen.cpp
parentMore marshalling updates (diff)
downloadice-21662dcec97bc2752f4b30e2ab23d3f29f65d535.tar.bz2
ice-21662dcec97bc2752f4b30e2ab23d3f29f65d535.tar.xz
ice-21662dcec97bc2752f4b30e2ab23d3f29f65d535.zip
Add file/line to LocalException
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r--cpp/src/slice2swift/Gen.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp
index 23433c3dd20..63749017723 100644
--- a/cpp/src/slice2swift/Gen.cpp
+++ b/cpp/src/slice2swift/Gen.cpp
@@ -302,11 +302,23 @@ Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p)
const DataMemberList allMembers = p->allDataMembers();
const DataMemberList baseMembers = base ? base->allDataMembers() : DataMemberList();
+ StringPairList extraParams;
+ if(p->isLocal())
+ {
+ extraParams.push_back(make_pair("file", "String = #file"));
+ extraParams.push_back(make_pair("line", "Int = #line"));
+ }
+
bool rootClass = !base && !p->isLocal();
// bool required =
writeMembers(out, members, p);
- writeDefaultInitializer(out, members, p, rootClass, true);
- writeMemberwiseInitializer(out, members, baseMembers, allMembers, p, rootClass);
+
+ // Local exceptions do not need default initializers
+ if(!p->isLocal())
+ {
+ writeDefaultInitializer(out, members, p, rootClass, true);
+ }
+ writeMemberwiseInitializer(out, members, baseMembers, allMembers, p, rootClass, extraParams);
if(!p->isLocal())
{