From 7b07fbcba0a8df16ff890830f399d9c82152f04a Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Tue, 30 Jul 2013 03:08:17 +0200 Subject: [PATCH] THRIFT-2100 typedefs are not correctly referenced when including from other thrift files Patch: Remo Hertig --- compiler/cpp/src/generate/t_go_generator.cc | 2 +- lib/go/test/IncludesTest.thrift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/cpp/src/generate/t_go_generator.cc b/compiler/cpp/src/generate/t_go_generator.cc index 4a388854..30be7991 100644 --- a/compiler/cpp/src/generate/t_go_generator.cc +++ b/compiler/cpp/src/generate/t_go_generator.cc @@ -3229,7 +3229,7 @@ string t_go_generator::type_to_go_type(t_type* type) string elemType = type_to_go_type(t->get_elem_type()); return string("[]") + elemType; } else if (type->is_typedef()) { - return publicize(((t_typedef*)type)->get_symbolic()); + return publicize(type_name(type)); } throw "INVALID TYPE IN type_to_go_type: " + type->get_name(); diff --git a/lib/go/test/IncludesTest.thrift b/lib/go/test/IncludesTest.thrift index 6b688062..6c7308b0 100644 --- a/lib/go/test/IncludesTest.thrift +++ b/lib/go/test/IncludesTest.thrift @@ -28,6 +28,7 @@ struct testStruct { struct TestStruct2 { 1: testStruct blah, + 2: ThriftTest.UserId id } service testService extends ThriftTest.SecondService { -- 2.17.1