From 1eec5b0e4c379d927db014a3b89f01ea0b00713e Mon Sep 17 00:00:00 2001 From: dhasenan Date: Sat, 21 Oct 2017 08:29:44 -0700 Subject: [PATCH] THRIFT-4306 dlang: public imports for dependencies If you have an IDL file that imports another IDL file, you can define a service that accepts, yields, or throws types defined in the imported file. In this case, the dlang output should ensure that the types defined in the imported IDL module are visible in the service interface's module. The generator failed to do that, resulting in a failure to compile the generated source in these situations. This was previously accepted by the compiler due to some long-standing bugs with symbol visibility, but the compiler bugs have been resolved. Fixes #4306. --- compiler/cpp/src/thrift/generate/t_d_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cpp/src/thrift/generate/t_d_generator.cc b/compiler/cpp/src/thrift/generate/t_d_generator.cc index b602e0d63cc..159d93a1fbd 100644 --- a/compiler/cpp/src/thrift/generate/t_d_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_d_generator.cc @@ -103,7 +103,7 @@ class t_d_generator : public t_oop_generator { // Include type modules from other imported programs. const vector& includes = program_->get_includes(); for (size_t i = 0; i < includes.size(); ++i) { - f_types_ << "import " << render_package(*(includes[i])) << includes[i]->get_name() + f_types_ << "public import " << render_package(*(includes[i])) << includes[i]->get_name() << "_types;" << endl; } if (!includes.empty())