diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2018-02-26 17:23:27 +0100 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2018-02-27 08:11:18 +0100 |
commit | 43c58ccedb9f38664f9ff81b08cb9ae33a7ba8d4 (patch) | |
tree | 0b4f0a96f1d5d929c150c92ab2c5246dbd625afd /src/compiler | |
parent | 0dc7c5996ce5091a96632919a3e3befe351b44d0 (diff) |
explicit naming of types in generated code
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/csharp_generator.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 7c97056402..6e2730579a 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -451,8 +451,10 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) { out->Print( "public virtual $response$ $methodname$($request$ request, " "grpc::Metadata " - "headers = null, DateTime? deadline = null, CancellationToken " - "cancellationToken = default(CancellationToken))\n", + "headers = null, global::System.DateTime? deadline = null, " + "global::System.Threading.CancellationToken " + "cancellationToken = " + "default(global::System.Threading.CancellationToken))\n", "methodname", method->name(), "request", GetClassName(method->input_type()), "response", GetClassName(method->output_type())); @@ -492,8 +494,10 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) { out->Print( "public virtual $returntype$ " "$methodname$($request_maybe$grpc::Metadata " - "headers = null, DateTime? deadline = null, CancellationToken " - "cancellationToken = default(CancellationToken))\n", + "headers = null, global::System.DateTime? deadline = null, " + "global::System.Threading.CancellationToken " + "cancellationToken = " + "default(global::System.Threading.CancellationToken))\n", "methodname", method_name, "request_maybe", GetMethodRequestParamMaybe(method), "returntype", GetMethodReturnTypeClient(method)); @@ -675,9 +679,6 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client, out.Print("#pragma warning disable 1591\n"); out.Print("#region Designer generated code\n"); out.Print("\n"); - out.Print("using System;\n"); - out.Print("using System.Threading;\n"); - out.Print("using System.Threading.Tasks;\n"); out.Print("using grpc = global::Grpc.Core;\n"); out.Print("\n"); |