From 43c58ccedb9f38664f9ff81b08cb9ae33a7ba8d4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 26 Feb 2018 17:23:27 +0100 Subject: explicit naming of types in generated code --- src/compiler/csharp_generator.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/compiler') 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"); -- cgit v1.2.3