diff options
author | Joe George <joe@zeroc.com> | 2019-04-01 15:25:23 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2019-04-01 15:29:16 -0400 |
commit | 477a623a5ee547f10f0be993e753c4155ad84585 (patch) | |
tree | f55055353ffe21b045cbbfd053ea8e51ec656a92 /cpp/src/slice2swift/Gen.cpp | |
parent | Remove unused vars (diff) | |
download | ice-477a623a5ee547f10f0be993e753c4155ad84585.tar.bz2 ice-477a623a5ee547f10f0be993e753c4155ad84585.tar.xz ice-477a623a5ee547f10f0be993e753c4155ad84585.zip |
slice2swift Object fixes
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r-- | cpp/src/slice2swift/Gen.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index 0b959d1ea66..5f127e6828a 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -1232,7 +1232,7 @@ Gen::ObjectVisitor::visitOperation(const OperationPtr& op) { const bool isAmd = operationIsAmd(op); const string swiftModule = getSwiftModule(getTopLevelModule(ContainedPtr::dynamicCast(op))); - const string opName = fixIdent(op->name()) + (isAmd ? "Async" : ""); + const string opName = fixIdent(op->name() + (isAmd ? "Async" : "")); const ParamInfoList allInParams = getAllInParams(op); const ParamInfoList allOutParams = getAllOutParams(op); const ExceptionList allExceptions = op->throws(); @@ -1249,33 +1249,17 @@ Gen::ObjectVisitor::visitOperation(const OperationPtr& op) out << ("current: " + getUnqualified("Ice.Current", swiftModule)); out << epar; - if(!isAmd) - { - out << " throws"; - } - - if(isAmd || allOutParams.size() > 0) - { - out << " -> "; - } - if(isAmd) { - out << "PromiseKit.Promise<"; + out << " -> PromiseKit.Promise<" << (allOutParams.size() > 0 ? operationReturnType(op) : "Void") << ">"; } - - if(allOutParams.size() > 0) - { - out << operationReturnType(op); - } - else if(isAmd) - { - out << "Void"; - } - - if(isAmd) + else { - out << ">"; + out << " throws"; + if(allOutParams.size() > 0) + { + out << " -> " << operationReturnType(op); + } } } |