summaryrefslogtreecommitdiff
path: root/cpp/src/slice2swift/Gen.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-03-15 23:18:14 +0100
committerJose <jose@zeroc.com>2019-03-15 23:18:14 +0100
commit57f2bf98ce0bdbf77897aff72bce7b0b83d33fa2 (patch)
treea708ef809414f1fb10ecc61b79cfa0f7d6caefed /cpp/src/slice2swift/Gen.cpp
parentRegenerate Xcode projects (diff)
downloadice-57f2bf98ce0bdbf77897aff72bce7b0b83d33fa2.tar.bz2
ice-57f2bf98ce0bdbf77897aff72bce7b0b83d33fa2.tar.xz
ice-57f2bf98ce0bdbf77897aff72bce7b0b83d33fa2.zip
Fix for Proxies and local generated methods
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r--cpp/src/slice2swift/Gen.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp
index b01b44cfc21..91125ec7faa 100644
--- a/cpp/src/slice2swift/Gen.cpp
+++ b/cpp/src/slice2swift/Gen.cpp
@@ -1231,23 +1231,25 @@ Gen::LocalObjectVisitor::visitOperation(const OperationPtr& p)
{
const string name = fixIdent(p->name());
ParamDeclList params = p->parameters();
+ ParamDeclList inParams = p->inParameters();
int typeCtx = TypeContextInParam | TypeContextLocal;
out << sp;
out << nl << "func " << name;
out << spar;
- for(ParamDeclList::const_iterator i = params.begin(); i != params.end(); ++i)
+ for(ParamDeclList::const_iterator i = inParams.begin(); i != inParams.end(); ++i)
{
ParamDeclPtr param = *i;
- if(!param->isOutParam())
+ TypePtr type = param->type();
+ ostringstream s;
+ if(inParams.size() == 1)
{
- TypePtr type = param->type();
- ostringstream s;
- s << fixIdent(param->name()) << ": "
- << typeToString(type, p, param->getMetaData(), param->optional(), typeCtx);
- out << s.str();
+ s << "_ ";
}
+ s << fixIdent(param->name()) << ": "
+ << typeToString(type, p, param->getMetaData(), param->optional(), typeCtx);
+ out << s.str();
}
out << epar;