diff options
author | Joe George <joe@zeroc.com> | 2019-04-05 16:30:22 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2019-04-05 16:31:54 -0400 |
commit | 326afad01b4d24653638148f4decaf9cf7de9fe8 (patch) | |
tree | 78df7d266ee018980cc8b2296974dc5330d6af16 /cpp/src/slice2swift/Gen.cpp | |
parent | Fix type qualifications (diff) | |
download | ice-326afad01b4d24653638148f4decaf9cf7de9fe8.tar.bz2 ice-326afad01b4d24653638148f4decaf9cf7de9fe8.tar.xz ice-326afad01b4d24653638148f4decaf9cf7de9fe8.zip |
Make LocalExceptions CustomStringConvertible
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r-- | cpp/src/slice2swift/Gen.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index 075a8ec5458..64f36904da5 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -391,7 +391,21 @@ Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) } writeMemberwiseInitializer(out, members, baseMembers, allMembers, p, rootClass, extraParams); - if(!p->isLocal()) + out << sp; + out << nl << "open override class func ice_staticId() -> Swift.String"; + out << sb; + out << nl << "return \"" << p->scoped() << "\""; + out << eb; + + if(p->isLocal()) + { + out << sp; + out << nl << "open override func ice_print() -> String"; + out << sb; + out << nl << "return _" << name << "Description"; + out << eb; + } + else { out << sp; out << nl << "override open func _iceWriteImpl(to ostr: " @@ -433,17 +447,6 @@ Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) out << nl << "return true"; out << eb; } - out << sp; - out << nl << "override open func ice_id() -> Swift.String"; - out << sb; - out << nl << "return \"" << p->scoped() << "\""; - out << eb; - - out << sp; - out << nl << "override open class func ice_staticId() -> Swift.String"; - out << sb; - out << nl << "return \"" << p->scoped() << "\""; - out << eb; if(preserved && !basePreserved) { |