Fix naming conflict
authorTJ Yin <[email protected]>
Fri, 31 Oct 2025 02:42:47 +0000 (30 19:42 -0700)
committermeta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com>
Fri, 31 Oct 2025 02:42:47 +0000 (30 19:42 -0700)
Summary: `fbthrift_field` prefix is reserved for field data. We should not reuse it for field annotations.

Reviewed By: iahs

Differential Revision: D85891727

fbshipit-source-id: 5c47b21ed357c9493e63132d277e5e1762671104

third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_types.h.mustache
third-party/thrift/src/thrift/compiler/test/fixtures/basic-structured-annotations/out/cpp2/gen-cpp2/module_types.h
third-party/thrift/src/thrift/compiler/test/fixtures/runtime-annotations/out/cpp2/gen-cpp2/module_types.h
third-party/thrift/src/thrift/lib/cpp2/Thrift.h

index 534b293..01d7aed 100644 (file)
@@ -158,7 +158,7 @@ class {{#struct:exception?}}FOLLY_EXPORT {{/struct:exception?}}{{struct:cpp_unde
     ::apache::thrift::type::field_id<{{field:id}}>{{^last?}}, {{/last?}}
 {{/struct:fields_with_runtime_annotation}}
   >;
-  using __fbthrift_field_annotations = folly::tag_t<
+  using __fbthrift_annotations_on_fields = folly::tag_t<
 {{#struct:fields_with_runtime_annotation}}
     folly::tag_t<
 {{#field:structured_runtime_annotations}}{{#constant:type}}
index d5022ab..8400c05 100644 (file)
@@ -1214,7 +1214,7 @@ class MyStruct final  {
   using __fbthrift_list_of_field_with_annotation = folly::tag_t<
     ::apache::thrift::type::field_id<1>
   >;
-  using __fbthrift_field_annotations = folly::tag_t<
+  using __fbthrift_annotations_on_fields = folly::tag_t<
     folly::tag_t<
       ::test::fixtures::basic_structured_annotations::runtime_annotation
     >
index 4a076e8..cea446d 100644 (file)
@@ -222,7 +222,7 @@ class MyStruct final  {
   using __fbthrift_list_of_field_with_annotation = folly::tag_t<
     ::apache::thrift::type::field_id<1>
   >;
-  using __fbthrift_field_annotations = folly::tag_t<
+  using __fbthrift_annotations_on_fields = folly::tag_t<
     folly::tag_t<
       ::facebook::thrift::test::MyAnnotation
     >
@@ -366,7 +366,7 @@ class MyUnion final  {
   using __fbthrift_list_of_field_with_annotation = folly::tag_t<
     ::apache::thrift::type::field_id<1>
   >;
-  using __fbthrift_field_annotations = folly::tag_t<
+  using __fbthrift_annotations_on_fields = folly::tag_t<
     folly::tag_t<
       ::facebook::thrift::test::MyAnnotation
     >
@@ -510,7 +510,7 @@ class FOLLY_EXPORT MyException : public virtual apache::thrift::TException {
   using __fbthrift_list_of_field_with_annotation = folly::tag_t<
     ::apache::thrift::type::field_id<1>
   >;
-  using __fbthrift_field_annotations = folly::tag_t<
+  using __fbthrift_annotations_on_fields = folly::tag_t<
     folly::tag_t<
       ::facebook::thrift::test::MyAnnotation
     >
index d1a2e24..22daf0e 100644 (file)
@@ -163,7 +163,7 @@ struct struct_private_access {
             Annotation,
             folly::type_list_element_t<
                 index,
-                typename T::__fbthrift_field_annotations>>;
+                typename T::__fbthrift_annotations_on_fields>>;
       }
     }
     return false;