summaryrefslogtreecommitdiff
path: root/cpp/src/slice2swift/SwiftUtil.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-05-22 22:06:26 +0200
committerJose <jose@zeroc.com>2019-05-22 22:06:26 +0200
commit029605a948e63d1b3a92a782ccb0a456ee87560c (patch)
treecf3775c3458f914e1a36c2b1d3117b15603d8241 /cpp/src/slice2swift/SwiftUtil.cpp
parentRegenerate Xcode projects (diff)
downloadice-029605a948e63d1b3a92a782ccb0a456ee87560c.tar.bz2
ice-029605a948e63d1b3a92a782ccb0a456ee87560c.tar.xz
ice-029605a948e63d1b3a92a782ccb0a456ee87560c.zip
Use nil as default value for optional parameters
Diffstat (limited to 'cpp/src/slice2swift/SwiftUtil.cpp')
-rw-r--r--cpp/src/slice2swift/SwiftUtil.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/slice2swift/SwiftUtil.cpp b/cpp/src/slice2swift/SwiftUtil.cpp
index 5623ddea445..dbf4b9452a2 100644
--- a/cpp/src/slice2swift/SwiftUtil.cpp
+++ b/cpp/src/slice2swift/SwiftUtil.cpp
@@ -1760,11 +1760,11 @@ SwiftGenerator::writeProxyOperation(::IceUtilInternal::Output& out, const Operat
{
if(allInParams.size() == 1)
{
- out << ("_ iceP_" + q->name + ": " + q->typeStr);
+ out << ("_ iceP_" + q->name + ": " + q->typeStr + (q->optional ? " = nil" : ""));
}
else
{
- out << (q->name + " iceP_" + q->name + ": " + q->typeStr);
+ out << (q->name + " iceP_" + q->name + ": " + q->typeStr + (q->optional ? " = nil" : ""));
}
}
out << ("context: " + getUnqualified("Ice.Context", swiftModule) + "? = nil");
@@ -1845,11 +1845,11 @@ SwiftGenerator::writeProxyAsyncOperation(::IceUtilInternal::Output& out, const O
{
if(allInParams.size() == 1)
{
- out << ("_ iceP_" + q->name + ": " + q->typeStr);
+ out << ("_ iceP_" + q->name + ": " + q->typeStr + (q->optional ? " = nil" : ""));
}
else
{
- out << (q->name + " iceP_" + q->name + ": " + q->typeStr);
+ out << (q->name + " iceP_" + q->name + ": " + q->typeStr + (q->optional ? " = nil" : ""));
}
}
out << "context: " + getUnqualified("Ice.Context", swiftModule) + "? = nil";