From 326afad01b4d24653638148f4decaf9cf7de9fe8 Mon Sep 17 00:00:00 2001 From: Joe George Date: Fri, 5 Apr 2019 16:30:22 -0400 Subject: Make LocalExceptions CustomStringConvertible --- cpp/src/slice2swift/Gen.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'cpp/src/slice2swift/Gen.cpp') 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) { -- cgit v1.2.3