Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,21 @@ public void generateCode(SwiftWriter swiftWriter, String javaFullName, String sw
swiftWriter.emitStatement(String.format("let %s: %s%s", param.name, param.swiftType.swiftType, param.isOptional ? "?" : ""));
}

boolean shouldCatchPreamble = params.size() > 0 || !isStatic;

boolean shouldCatchPreamble = false;
if (isStatic) {
for (SwiftParamDescriptor param : params) {
// primitive types constructors not throw
if (param.isOptional || !param.isPrimitive()) {
shouldCatchPreamble = true;
break;
}
}
}
else {
shouldCatchPreamble = true;
}

if (shouldCatchPreamble) {
swiftWriter.emitStatement("do {");
}
Expand Down