Skip to content

Commit 87c3b84

Browse files
generatedunixname89002005232357meta-codesync[bot]
authored andcommitted
Revert D91671374
Summary: This diff reverts D91671374 Blocking thrift compiler release Depends on D91671374 Differential Revision: D92538780 fbshipit-source-id: a0bd75970f280514992564bef3f7a372e5e4c0d2
1 parent 4456ded commit 87c3b84

238 files changed

Lines changed: 5505 additions & 21791 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

third-party/thrift/src/thrift/compiler/generate/t_hack_generator.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,8 @@ std::string t_hack_generator::render_const_value_helper(
20952095
out << temp_val;
20962096

20972097
set_indent(preserved_indent_size);
2098+
} else if (value->get_map().empty()) {
2099+
out << struct_name << "::withDefaultValues()";
20982100
} else {
20992101
out << struct_name << "::fromShape(\n";
21002102
indent_up();
@@ -4554,8 +4556,8 @@ void t_hack_generator::generate_php_struct_constructor_field_assignment(
45544556
}
45554557
std::string dval;
45564558
bool is_exception = tstruct->is<t_exception>();
4557-
if (field.default_value() != nullptr &&
4558-
!(t->is<t_structured>() || skip_custom_default)) {
4559+
if (field.default_value() != nullptr && !skip_custom_default &&
4560+
!(t->is<t_structured>() && legacy_default_values_)) {
45594561
dval = render_const_value(
45604562
t,
45614563
field.default_value(),

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/hack/gen-hack/Service.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,13 @@ public static function getAllStructuredAnnotations()[write_props]: \TStructAnnot
246246
'arg1' => shape(
247247
'field' => dict[],
248248
'type' => dict[
249-
'\facebook\thrift\annotation\AllowLegacyTypedefUri' => \facebook\thrift\annotation\AllowLegacyTypedefUri::fromShape(
250-
shape(
251-
)
252-
),
249+
'\facebook\thrift\annotation\AllowLegacyTypedefUri' => \facebook\thrift\annotation\AllowLegacyTypedefUri::withDefaultValues(),
253250
],
254251
),
255252
'arg2' => shape(
256253
'field' => dict[],
257254
'type' => dict[
258-
'\facebook\thrift\annotation\AllowLegacyTypedefUri' => \facebook\thrift\annotation\AllowLegacyTypedefUri::fromShape(
259-
shape(
260-
)
261-
),
255+
'\facebook\thrift\annotation\AllowLegacyTypedefUri' => \facebook\thrift\annotation\AllowLegacyTypedefUri::withDefaultValues(),
262256
'\facebook\thrift\annotation\cpp\Adapter' => \facebook\thrift\annotation\cpp\Adapter::fromShape(
263257
shape(
264258
"name" => "::my::Adapter2",
@@ -269,10 +263,7 @@ public static function getAllStructuredAnnotations()[write_props]: \TStructAnnot
269263
'arg3' => shape(
270264
'field' => dict[],
271265
'type' => dict[
272-
'\facebook\thrift\annotation\cpp\EnableCustomTypeOrdering' => \facebook\thrift\annotation\cpp\EnableCustomTypeOrdering::fromShape(
273-
shape(
274-
)
275-
),
266+
'\facebook\thrift\annotation\cpp\EnableCustomTypeOrdering' => \facebook\thrift\annotation\cpp\EnableCustomTypeOrdering::withDefaultValues(),
276267
],
277268
),
278269
],
@@ -422,10 +413,7 @@ public static function getAllStructuredAnnotations()[write_props]: \TStructAnnot
422413
'success' => shape(
423414
'field' => dict[],
424415
'type' => dict[
425-
'\facebook\thrift\annotation\AllowLegacyTypedefUri' => \facebook\thrift\annotation\AllowLegacyTypedefUri::fromShape(
426-
shape(
427-
)
428-
),
416+
'\facebook\thrift\annotation\AllowLegacyTypedefUri' => \facebook\thrift\annotation\AllowLegacyTypedefUri::withDefaultValues(),
429417
],
430418
),
431419
],

0 commit comments

Comments
 (0)