Skip to content
Snippets Groups Projects
Commit e107f8e6 authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Merge pull request #6205 from BenchR267/objc-nullability

Added nullability to service declaration in ObjC
parents e2fd6534 1843ccb2
No related branches found
No related tags found
No related merge requests found
......@@ -75,11 +75,11 @@ void PrintMethodSignature(Printer *printer, const MethodDescriptor *method,
if (method->server_streaming()) {
printer->Print(vars,
" eventHandler:(void(^)(BOOL done, "
"$response_class$ *response, NSError *error))eventHandler");
"$response_class$ *_Nullable response, NSError *_Nullable error))eventHandler");
} else {
printer->Print(vars,
" handler:(void(^)($response_class$ *response, "
"NSError *error))handler");
" handler:(void(^)($response_class$ *_Nullable response, "
"NSError *_Nullable error))handler");
}
}
......
......@@ -81,8 +81,12 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
declarations += grpc_objective_c_generator::GetHeader(service);
}
static const ::grpc::string kNonNullBegin = "\nNS_ASSUME_NONNULL_BEGIN\n\n";
static const ::grpc::string kNonNullEnd = "\nNS_ASSUME_NONNULL_END\n";
Write(context, file_name + ".pbrpc.h",
imports + '\n' + proto_imports + '\n' + declarations);
imports + '\n' + proto_imports + '\n' + kNonNullBegin +
declarations + kNonNullEnd);
}
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment