diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/cmd b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/cmd
new file mode 100644
index 00000000000000..ea63038e2be698
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/cmd
@@ -0,0 +1,13 @@
+android: android src/module.thrift
+ast: thrift2ast-ast:protocol=debug,root_program_only,use_hash,no_backcompat src/module.thrift
+cpp2: mstch_cpp2 src/module.thrift
+go: mstch_go src/module.thrift
+hack: hack:hack_collections=1 src/module.thrift
+java: mstch_java src/module.thrift
+java_deprecated: java_deprecated src/module.thrift
+json: json src/module.thrift
+json_experimental: json_experimental src/module.thrift
+py3: mstch_py3 src/module.thrift
+py: py src/module.thrift
+python: mstch_python src/module.thrift
+rust: mstch_rust src/module.thrift
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/android/gen-android/EmptyStruct.java b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/android/gen-android/EmptyStruct.java
new file mode 100644
index 00000000000000..017c2be236e9aa
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/android/gen-android/EmptyStruct.java
@@ -0,0 +1,114 @@
+/**
+ * Autogenerated by Thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.util.Arrays;
+import com.facebook.thrift.*;
+import com.facebook.thrift.annotations.*;
+import com.facebook.thrift.async.*;
+import com.facebook.thrift.meta_data.*;
+import com.facebook.thrift.server.*;
+import com.facebook.thrift.transport.*;
+import com.facebook.thrift.protocol.*;
+
+@SuppressWarnings({ "unused", "serial" })
+public class EmptyStruct implements TBase, java.io.Serializable, Cloneable {
+ private static final TStruct STRUCT_DESC = new TStruct("EmptyStruct");
+
+
+ public EmptyStruct() {
+ }
+
+ /**
+ * Performs a deep copy on other.
+ */
+ public EmptyStruct(EmptyStruct other) {
+ }
+
+ public EmptyStruct deepCopy() {
+ return new EmptyStruct(this);
+ }
+
+ @Override
+ public boolean equals(Object _that) {
+ if (_that == null)
+ return false;
+ if (this == _that)
+ return true;
+ if (!(_that instanceof EmptyStruct))
+ return false;
+ EmptyStruct that = (EmptyStruct)_that;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.deepHashCode(new Object[] {});
+ }
+
+ // This is required to satisfy the TBase interface, but can't be implemented on immutable struture.
+ public void read(TProtocol iprot) throws TException {
+ throw new TException("unimplemented in android immutable structure");
+ }
+
+ public static EmptyStruct deserialize(TProtocol iprot) throws TException {
+ TField __field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ __field = iprot.readFieldBegin();
+ if (__field.type == TType.STOP) {
+ break;
+ }
+ switch (__field.id)
+ {
+ default:
+ TProtocolUtil.skip(iprot, __field.type);
+ break;
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ EmptyStruct _that;
+ _that = new EmptyStruct(
+ );
+ _that.validate();
+ return _that;
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ return toString(1, true);
+ }
+
+ @Override
+ public String toString(int indent, boolean prettyPrint) {
+ return TBaseHelper.toStringHelper(this, indent, prettyPrint);
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ }
+
+}
+
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/android/gen-android/TestStruct.java b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/android/gen-android/TestStruct.java
new file mode 100644
index 00000000000000..d7392b979ae5e5
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/android/gen-android/TestStruct.java
@@ -0,0 +1,438 @@
+/**
+ * Autogenerated by Thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.util.Arrays;
+import com.facebook.thrift.*;
+import com.facebook.thrift.annotations.*;
+import com.facebook.thrift.async.*;
+import com.facebook.thrift.meta_data.*;
+import com.facebook.thrift.server.*;
+import com.facebook.thrift.transport.*;
+import com.facebook.thrift.protocol.*;
+
+@SuppressWarnings({ "unused", "serial" })
+public class TestStruct implements TBase, java.io.Serializable, Cloneable {
+ private static final TStruct STRUCT_DESC = new TStruct("TestStruct");
+ private static final TField UNQUALIFIED_INT_FIELD_FIELD_DESC = new TField("unqualified_int_field", TType.I32, (short)1);
+ private static final TField UNQUALIFIED_BOOL_FIELD_FIELD_DESC = new TField("unqualified_bool_field", TType.BOOL, (short)2);
+ private static final TField UNQUALIFIED_LIST_FIELD_FIELD_DESC = new TField("unqualified_list_field", TType.LIST, (short)3);
+ private static final TField UNQUALIFIED_STRUCT_FIELD_FIELD_DESC = new TField("unqualified_struct_field", TType.STRUCT, (short)4);
+ private static final TField OPTIONAL_INT_FIELD_FIELD_DESC = new TField("optional_int_field", TType.I32, (short)5);
+ private static final TField OPTIONAL_BOOL_FIELD_FIELD_DESC = new TField("optional_bool_field", TType.BOOL, (short)6);
+ private static final TField OPTIONAL_LIST_FIELD_FIELD_DESC = new TField("optional_list_field", TType.LIST, (short)7);
+ private static final TField OPTIONAL_STRUCT_FIELD_FIELD_DESC = new TField("optional_struct_field", TType.STRUCT, (short)8);
+
+ public final Integer unqualified_int_field;
+ public final Boolean unqualified_bool_field;
+ public final List unqualified_list_field;
+ public final EmptyStruct unqualified_struct_field;
+ public final Integer optional_int_field;
+ public final Boolean optional_bool_field;
+ public final List optional_list_field;
+ public final EmptyStruct optional_struct_field;
+ public static final int UNQUALIFIED_INT_FIELD = 1;
+ public static final int UNQUALIFIED_BOOL_FIELD = 2;
+ public static final int UNQUALIFIED_LIST_FIELD = 3;
+ public static final int UNQUALIFIED_STRUCT_FIELD = 4;
+ public static final int OPTIONAL_INT_FIELD = 5;
+ public static final int OPTIONAL_BOOL_FIELD = 6;
+ public static final int OPTIONAL_LIST_FIELD = 7;
+ public static final int OPTIONAL_STRUCT_FIELD = 8;
+
+ public TestStruct(
+ Integer unqualified_int_field,
+ Boolean unqualified_bool_field,
+ List unqualified_list_field,
+ EmptyStruct unqualified_struct_field,
+ Integer optional_int_field,
+ Boolean optional_bool_field,
+ List optional_list_field,
+ EmptyStruct optional_struct_field) {
+ this.unqualified_int_field = unqualified_int_field;
+ this.unqualified_bool_field = unqualified_bool_field;
+ this.unqualified_list_field = unqualified_list_field;
+ this.unqualified_struct_field = unqualified_struct_field;
+ this.optional_int_field = optional_int_field;
+ this.optional_bool_field = optional_bool_field;
+ this.optional_list_field = optional_list_field;
+ this.optional_struct_field = optional_struct_field;
+ }
+
+ /**
+ * Performs a deep copy on other.
+ */
+ public TestStruct(TestStruct other) {
+ if (other.isSetUnqualified_int_field()) {
+ this.unqualified_int_field = TBaseHelper.deepCopy(other.unqualified_int_field);
+ } else {
+ this.unqualified_int_field = null;
+ }
+ if (other.isSetUnqualified_bool_field()) {
+ this.unqualified_bool_field = TBaseHelper.deepCopy(other.unqualified_bool_field);
+ } else {
+ this.unqualified_bool_field = null;
+ }
+ if (other.isSetUnqualified_list_field()) {
+ this.unqualified_list_field = TBaseHelper.deepCopy(other.unqualified_list_field);
+ } else {
+ this.unqualified_list_field = null;
+ }
+ if (other.isSetUnqualified_struct_field()) {
+ this.unqualified_struct_field = TBaseHelper.deepCopy(other.unqualified_struct_field);
+ } else {
+ this.unqualified_struct_field = null;
+ }
+ if (other.isSetOptional_int_field()) {
+ this.optional_int_field = TBaseHelper.deepCopy(other.optional_int_field);
+ } else {
+ this.optional_int_field = null;
+ }
+ if (other.isSetOptional_bool_field()) {
+ this.optional_bool_field = TBaseHelper.deepCopy(other.optional_bool_field);
+ } else {
+ this.optional_bool_field = null;
+ }
+ if (other.isSetOptional_list_field()) {
+ this.optional_list_field = TBaseHelper.deepCopy(other.optional_list_field);
+ } else {
+ this.optional_list_field = null;
+ }
+ if (other.isSetOptional_struct_field()) {
+ this.optional_struct_field = TBaseHelper.deepCopy(other.optional_struct_field);
+ } else {
+ this.optional_struct_field = null;
+ }
+ }
+
+ public TestStruct deepCopy() {
+ return new TestStruct(this);
+ }
+
+ public Integer getUnqualified_int_field() {
+ return this.unqualified_int_field;
+ }
+
+ // Returns true if field unqualified_int_field is set (has been assigned a value) and false otherwise
+ public boolean isSetUnqualified_int_field() {
+ return this.unqualified_int_field != null;
+ }
+
+ public Boolean isUnqualified_bool_field() {
+ return this.unqualified_bool_field;
+ }
+
+ // Returns true if field unqualified_bool_field is set (has been assigned a value) and false otherwise
+ public boolean isSetUnqualified_bool_field() {
+ return this.unqualified_bool_field != null;
+ }
+
+ public List getUnqualified_list_field() {
+ return this.unqualified_list_field;
+ }
+
+ // Returns true if field unqualified_list_field is set (has been assigned a value) and false otherwise
+ public boolean isSetUnqualified_list_field() {
+ return this.unqualified_list_field != null;
+ }
+
+ public EmptyStruct getUnqualified_struct_field() {
+ return this.unqualified_struct_field;
+ }
+
+ // Returns true if field unqualified_struct_field is set (has been assigned a value) and false otherwise
+ public boolean isSetUnqualified_struct_field() {
+ return this.unqualified_struct_field != null;
+ }
+
+ public Integer getOptional_int_field() {
+ return this.optional_int_field;
+ }
+
+ // Returns true if field optional_int_field is set (has been assigned a value) and false otherwise
+ public boolean isSetOptional_int_field() {
+ return this.optional_int_field != null;
+ }
+
+ public Boolean isOptional_bool_field() {
+ return this.optional_bool_field;
+ }
+
+ // Returns true if field optional_bool_field is set (has been assigned a value) and false otherwise
+ public boolean isSetOptional_bool_field() {
+ return this.optional_bool_field != null;
+ }
+
+ public List getOptional_list_field() {
+ return this.optional_list_field;
+ }
+
+ // Returns true if field optional_list_field is set (has been assigned a value) and false otherwise
+ public boolean isSetOptional_list_field() {
+ return this.optional_list_field != null;
+ }
+
+ public EmptyStruct getOptional_struct_field() {
+ return this.optional_struct_field;
+ }
+
+ // Returns true if field optional_struct_field is set (has been assigned a value) and false otherwise
+ public boolean isSetOptional_struct_field() {
+ return this.optional_struct_field != null;
+ }
+
+ @Override
+ public boolean equals(Object _that) {
+ if (_that == null)
+ return false;
+ if (this == _that)
+ return true;
+ if (!(_that instanceof TestStruct))
+ return false;
+ TestStruct that = (TestStruct)_that;
+
+ if (!TBaseHelper.equalsNobinary(this.isSetUnqualified_int_field(), that.isSetUnqualified_int_field(), this.unqualified_int_field, that.unqualified_int_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetUnqualified_bool_field(), that.isSetUnqualified_bool_field(), this.unqualified_bool_field, that.unqualified_bool_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetUnqualified_list_field(), that.isSetUnqualified_list_field(), this.unqualified_list_field, that.unqualified_list_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetUnqualified_struct_field(), that.isSetUnqualified_struct_field(), this.unqualified_struct_field, that.unqualified_struct_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetOptional_int_field(), that.isSetOptional_int_field(), this.optional_int_field, that.optional_int_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetOptional_bool_field(), that.isSetOptional_bool_field(), this.optional_bool_field, that.optional_bool_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetOptional_list_field(), that.isSetOptional_list_field(), this.optional_list_field, that.optional_list_field)) { return false; }
+
+ if (!TBaseHelper.equalsNobinary(this.isSetOptional_struct_field(), that.isSetOptional_struct_field(), this.optional_struct_field, that.optional_struct_field)) { return false; }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.deepHashCode(new Object[] {unqualified_int_field, unqualified_bool_field, unqualified_list_field, unqualified_struct_field, optional_int_field, optional_bool_field, optional_list_field, optional_struct_field});
+ }
+
+ // This is required to satisfy the TBase interface, but can't be implemented on immutable struture.
+ public void read(TProtocol iprot) throws TException {
+ throw new TException("unimplemented in android immutable structure");
+ }
+
+ public static TestStruct deserialize(TProtocol iprot) throws TException {
+ Integer tmp_unqualified_int_field = null;
+ Boolean tmp_unqualified_bool_field = null;
+ List tmp_unqualified_list_field = null;
+ EmptyStruct tmp_unqualified_struct_field = null;
+ Integer tmp_optional_int_field = null;
+ Boolean tmp_optional_bool_field = null;
+ List tmp_optional_list_field = null;
+ EmptyStruct tmp_optional_struct_field = null;
+ TField __field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ __field = iprot.readFieldBegin();
+ if (__field.type == TType.STOP) {
+ break;
+ }
+ switch (__field.id)
+ {
+ case UNQUALIFIED_INT_FIELD:
+ if (__field.type == TType.I32) {
+ tmp_unqualified_int_field = iprot.readI32();
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case UNQUALIFIED_BOOL_FIELD:
+ if (__field.type == TType.BOOL) {
+ tmp_unqualified_bool_field = iprot.readBool();
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case UNQUALIFIED_LIST_FIELD:
+ if (__field.type == TType.LIST) {
+ {
+ TList _list0 = iprot.readListBegin();
+ tmp_unqualified_list_field = new ArrayList(Math.max(0, _list0.size));
+ for (int _i1 = 0;
+ (_list0.size < 0) ? iprot.peekList() : (_i1 < _list0.size);
+ ++_i1)
+ {
+ Integer _elem2;
+ _elem2 = iprot.readI32();
+ tmp_unqualified_list_field.add(_elem2);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case UNQUALIFIED_STRUCT_FIELD:
+ if (__field.type == TType.STRUCT) {
+ tmp_unqualified_struct_field = EmptyStruct.deserialize(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case OPTIONAL_INT_FIELD:
+ if (__field.type == TType.I32) {
+ tmp_optional_int_field = iprot.readI32();
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case OPTIONAL_BOOL_FIELD:
+ if (__field.type == TType.BOOL) {
+ tmp_optional_bool_field = iprot.readBool();
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case OPTIONAL_LIST_FIELD:
+ if (__field.type == TType.LIST) {
+ {
+ TList _list3 = iprot.readListBegin();
+ tmp_optional_list_field = new ArrayList(Math.max(0, _list3.size));
+ for (int _i4 = 0;
+ (_list3.size < 0) ? iprot.peekList() : (_i4 < _list3.size);
+ ++_i4)
+ {
+ Integer _elem5;
+ _elem5 = iprot.readI32();
+ tmp_optional_list_field.add(_elem5);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ case OPTIONAL_STRUCT_FIELD:
+ if (__field.type == TType.STRUCT) {
+ tmp_optional_struct_field = EmptyStruct.deserialize(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, __field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, __field.type);
+ break;
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ TestStruct _that;
+ _that = new TestStruct(
+ tmp_unqualified_int_field
+ ,tmp_unqualified_bool_field
+ ,tmp_unqualified_list_field
+ ,tmp_unqualified_struct_field
+ ,tmp_optional_int_field
+ ,tmp_optional_bool_field
+ ,tmp_optional_list_field
+ ,tmp_optional_struct_field
+ );
+ _that.validate();
+ return _that;
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (this.unqualified_int_field != null) {
+ oprot.writeFieldBegin(UNQUALIFIED_INT_FIELD_FIELD_DESC);
+ oprot.writeI32(this.unqualified_int_field);
+ oprot.writeFieldEnd();
+ }
+ if (this.unqualified_bool_field != null) {
+ oprot.writeFieldBegin(UNQUALIFIED_BOOL_FIELD_FIELD_DESC);
+ oprot.writeBool(this.unqualified_bool_field);
+ oprot.writeFieldEnd();
+ }
+ if (this.unqualified_list_field != null) {
+ oprot.writeFieldBegin(UNQUALIFIED_LIST_FIELD_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.I32, this.unqualified_list_field.size()));
+ for (Integer _iter6 : this.unqualified_list_field) {
+ oprot.writeI32(_iter6);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (this.unqualified_struct_field != null) {
+ oprot.writeFieldBegin(UNQUALIFIED_STRUCT_FIELD_FIELD_DESC);
+ this.unqualified_struct_field.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (this.optional_int_field != null) {
+ if (isSetOptional_int_field()) {
+ oprot.writeFieldBegin(OPTIONAL_INT_FIELD_FIELD_DESC);
+ oprot.writeI32(this.optional_int_field);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (this.optional_bool_field != null) {
+ if (isSetOptional_bool_field()) {
+ oprot.writeFieldBegin(OPTIONAL_BOOL_FIELD_FIELD_DESC);
+ oprot.writeBool(this.optional_bool_field);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (this.optional_list_field != null) {
+ if (isSetOptional_list_field()) {
+ oprot.writeFieldBegin(OPTIONAL_LIST_FIELD_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.I32, this.optional_list_field.size()));
+ for (Integer _iter7 : this.optional_list_field) {
+ oprot.writeI32(_iter7);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ }
+ if (this.optional_struct_field != null) {
+ if (isSetOptional_struct_field()) {
+ oprot.writeFieldBegin(OPTIONAL_STRUCT_FIELD_FIELD_DESC);
+ this.optional_struct_field.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ return toString(1, true);
+ }
+
+ @Override
+ public String toString(int indent, boolean prettyPrint) {
+ return TBaseHelper.toStringHelper(this, indent, prettyPrint);
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ }
+
+}
+
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/ast/gen-ast/module.ast b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/ast/gen-ast/module.ast
new file mode 100644
index 00000000000000..dba8485126c5e4
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/ast/gen-ast/module.ast
@@ -0,0 +1,232 @@
+Schema {
+ 1: programs (list) = list[1] {
+ [0] = Program {
+ 1: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "module",
+ 2: uri (string) = "facebook.com/thrift/compiler/test/fixtures/default_values_rectification",
+ },
+ 2: id (i64) = -8019751949614625057,
+ 8: definitionKeys (list) = list[2] {
+ [0] = ">\364\204\333\021k\245\343\272\021\231}\266l\332\212",
+ [1] = "\323\255\366\333\327\007\024\003\277|K\330\201dL\324",
+ },
+ 5: path (string) = "thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift",
+ },
+ },
+ 8: definitionsMap (map) = map[2] {
+ ">\364\204\333\021k\245\343\272\021\231}\266l\332\212" -> Definition {
+ 1: structDef (struct) = Struct {
+ 1: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "EmptyStruct",
+ 2: uri (string) = "facebook.com/thrift/compiler/test/fixtures/default_values_rectification/EmptyStruct",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 19,
+ 3: beginColumn (i32) = 1,
+ 4: endLine (i32) = 19,
+ 5: endColumn (i32) = 22,
+ },
+ },
+ },
+ },
+ "\323\255\366\333\327\007\024\003\277|K\330\201dL\324" -> Definition {
+ 1: structDef (struct) = Struct {
+ 1: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "TestStruct",
+ 2: uri (string) = "facebook.com/thrift/compiler/test/fixtures/default_values_rectification/TestStruct",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 21,
+ 3: beginColumn (i32) = 1,
+ 4: endLine (i32) = 37,
+ 5: endColumn (i32) = 2,
+ },
+ },
+ 2: fields (list) = list[8] {
+ [0] = Field {
+ 1: id (i16) = 1,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 4: i32Type (i32) = 0,
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "unqualified_int_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 22,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 22,
+ 5: endColumn (i32) = 32,
+ },
+ },
+ },
+ [1] = Field {
+ 1: id (i16) = 2,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 1: boolType (i32) = 0,
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "unqualified_bool_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 24,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 24,
+ 5: endColumn (i32) = 34,
+ },
+ },
+ },
+ [2] = Field {
+ 1: id (i16) = 3,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 14: listType (i32) = 0,
+ },
+ 2: params (list) = list[1] {
+ [0] = TypeStruct {
+ 1: name (struct) = TypeName {
+ 4: i32Type (i32) = 0,
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "unqualified_list_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 26,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 26,
+ 5: endColumn (i32) = 39,
+ },
+ },
+ },
+ [3] = Field {
+ 1: id (i16) = 4,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 11: structType (struct) = TypeUri {
+ 4: definitionKey (string) = ">\364\204\333\021k\245\343\272\021\231}\266l\332\212",
+ },
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "unqualified_struct_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 28,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 28,
+ 5: endColumn (i32) = 43,
+ },
+ },
+ },
+ [4] = Field {
+ 1: id (i16) = 5,
+ 2: qualifier (i32) = 1,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 4: i32Type (i32) = 0,
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "optional_int_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 30,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 30,
+ 5: endColumn (i32) = 38,
+ },
+ },
+ },
+ [5] = Field {
+ 1: id (i16) = 6,
+ 2: qualifier (i32) = 1,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 1: boolType (i32) = 0,
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "optional_bool_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 32,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 32,
+ 5: endColumn (i32) = 40,
+ },
+ },
+ },
+ [6] = Field {
+ 1: id (i16) = 7,
+ 2: qualifier (i32) = 1,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 14: listType (i32) = 0,
+ },
+ 2: params (list) = list[1] {
+ [0] = TypeStruct {
+ 1: name (struct) = TypeName {
+ 4: i32Type (i32) = 0,
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "optional_list_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 34,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 34,
+ 5: endColumn (i32) = 45,
+ },
+ },
+ },
+ [7] = Field {
+ 1: id (i16) = 8,
+ 2: qualifier (i32) = 1,
+ 3: type (struct) = TypeStruct {
+ 1: name (struct) = TypeName {
+ 11: structType (struct) = TypeUri {
+ 4: definitionKey (string) = ">\364\204\333\021k\245\343\272\021\231}\266l\332\212",
+ },
+ },
+ 2: params (list) = list[0] {
+ },
+ },
+ 4: attrs (struct) = DefinitionAttrs {
+ 1: name (string) = "optional_struct_field",
+ 7: sourceRange (struct) = SourceRange {
+ 1: programId (i64) = -8019751949614625057,
+ 2: beginLine (i32) = 36,
+ 3: beginColumn (i32) = 3,
+ 4: endLine (i32) = 36,
+ 5: endColumn (i32) = 49,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+}
\ No newline at end of file
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_clients.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_clients.h
new file mode 100644
index 00000000000000..63856004a06e3b
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_clients.h
@@ -0,0 +1,8 @@
+/**
+ * Autogenerated by Thrift for
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_constants.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_constants.cpp
new file mode 100644
index 00000000000000..94ad553dc78b9f
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_constants.cpp
@@ -0,0 +1,25 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_constants.h"
+
+#include
+
+
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification {
+namespace module_constants {
+
+
+::std::string_view _fbthrift_schema_90b41e17a0794edf() {
+ return "";
+}
+::folly::Range _fbthrift_schema_90b41e17a0794edf_includes() {
+ return {};
+}
+
+} // namespace module_constants
+} // namespace facebook::thrift::compiler::test::fixtures::default_values_rectification
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_constants.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_constants.h
new file mode 100644
index 00000000000000..62f3f7f04c2eef
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_constants.h
@@ -0,0 +1,21 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
+#include
+
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_types.h"
+
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification {
+/** Glean {"file": "thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift"} */
+namespace module_constants {
+
+ FOLLY_EXPORT ::std::string_view _fbthrift_schema_90b41e17a0794edf();
+ FOLLY_EXPORT ::folly::Range _fbthrift_schema_90b41e17a0794edf_includes();
+
+} // namespace module_constants
+} // namespace facebook::thrift::compiler::test::fixtures::default_values_rectification
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_data.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_data.cpp
new file mode 100644
index 00000000000000..1ef2972872f8b4
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_data.cpp
@@ -0,0 +1,101 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_data.h"
+
+#include
+
+FOLLY_CLANG_DISABLE_WARNING("-Wunused-macros")
+
+#if defined(__GNUC__) && defined(__linux__) && !FOLLY_MOBILE
+// These attributes are applied to the static data members to ensure that they
+// are not stripped from the compiled binary, in order to keep them available
+// for use by debuggers at runtime.
+//
+// The "used" attribute is required to ensure the compiler always emits unused
+// data.
+//
+// The "section" attribute is required to stop the linker from stripping used
+// data. It works by forcing all of the data members (both used and unused ones)
+// into the same section. As the linker strips data on a per-section basis, it
+// is then unable to remove unused data without also removing used data.
+// This has a similar effect to the "retain" attribute, but works with older
+// toolchains.
+#define THRIFT_DATA_MEMBER [[gnu::used]] [[gnu::section(".rodata.thrift.data")]]
+#else
+#define THRIFT_DATA_MEMBER
+#endif
+
+namespace apache {
+namespace thrift {
+
+THRIFT_DATA_MEMBER const std::string_view TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::name = "EmptyStruct";
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::fields_names = { {
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::fields_ids = { {
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::fields_types = { {
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::storage_names = { {
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::isset_indexes = { {
+}};
+
+THRIFT_DATA_MEMBER const std::string_view TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::name = "TestStruct";
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::fields_names = { {
+ "unqualified_int_field"sv,
+ "unqualified_bool_field"sv,
+ "unqualified_list_field"sv,
+ "unqualified_struct_field"sv,
+ "optional_int_field"sv,
+ "optional_bool_field"sv,
+ "optional_list_field"sv,
+ "optional_struct_field"sv,
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::fields_ids = { {
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::fields_types = { {
+ TType::T_I32,
+ TType::T_BOOL,
+ TType::T_LIST,
+ TType::T_STRUCT,
+ TType::T_I32,
+ TType::T_BOOL,
+ TType::T_LIST,
+ TType::T_STRUCT,
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::storage_names = { {
+ "__fbthrift_field_unqualified_int_field"sv,
+ "__fbthrift_field_unqualified_bool_field"sv,
+ "__fbthrift_field_unqualified_list_field"sv,
+ "__fbthrift_field_unqualified_struct_field"sv,
+ "__fbthrift_field_optional_int_field"sv,
+ "__fbthrift_field_optional_bool_field"sv,
+ "__fbthrift_field_optional_list_field"sv,
+ "__fbthrift_field_optional_struct_field"sv,
+}};
+THRIFT_DATA_MEMBER const std::array TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::isset_indexes = { {
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+}};
+
+} // namespace thrift
+} // namespace apache
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_data.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_data.h
new file mode 100644
index 00000000000000..1323f796c571b2
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_data.h
@@ -0,0 +1,47 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
+#include
+
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_types.h"
+
+namespace apache { namespace thrift {
+
+template <> struct TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct> {
+ static constexpr const std::size_t fields_size = 0;
+ static const std::string_view name;
+ static const std::array fields_names;
+ static const std::array fields_ids;
+ static const std::array fields_types;
+
+ private:
+ // The following fields describe internal storage metadata, and are private to
+ // prevent user logic from accessing them, but they can be inspected by
+ // debuggers.
+ static const std::array storage_names;
+ // -1 if the field has no isset.
+ static const std::array isset_indexes;
+};
+
+template <> struct TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct> {
+ static constexpr const std::size_t fields_size = 8;
+ static const std::string_view name;
+ static const std::array fields_names;
+ static const std::array fields_ids;
+ static const std::array fields_types;
+
+ private:
+ // The following fields describe internal storage metadata, and are private to
+ // prevent user logic from accessing them, but they can be inspected by
+ // debuggers.
+ static const std::array storage_names;
+ // -1 if the field has no isset.
+ static const std::array isset_indexes;
+};
+
+}} // apache::thrift
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_for_each_field.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_for_each_field.h
new file mode 100644
index 00000000000000..2b90092e96887a
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_for_each_field.h
@@ -0,0 +1,39 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_metadata.h"
+#include
+
+namespace apache {
+namespace thrift {
+namespace detail {
+
+template <>
+struct ForEachField<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct> {
+ template
+ void operator()([[maybe_unused]] F&& f, [[maybe_unused]] T&&... t) const {
+ }
+};
+
+template <>
+struct ForEachField<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct> {
+ template
+ void operator()([[maybe_unused]] F&& f, [[maybe_unused]] T&&... t) const {
+ f(0, static_cast(t).unqualified_int_field_ref()...);
+ f(1, static_cast(t).unqualified_bool_field_ref()...);
+ f(2, static_cast(t).unqualified_list_field_ref()...);
+ f(3, static_cast(t).unqualified_struct_field_ref()...);
+ f(4, static_cast(t).optional_int_field_ref()...);
+ f(5, static_cast(t).optional_bool_field_ref()...);
+ f(6, static_cast(t).optional_list_field_ref()...);
+ f(7, static_cast(t).optional_struct_field_ref()...);
+ }
+};
+} // namespace detail
+} // namespace thrift
+} // namespace apache
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_handlers.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_handlers.h
new file mode 100644
index 00000000000000..63856004a06e3b
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_handlers.h
@@ -0,0 +1,8 @@
+/**
+ * Autogenerated by Thrift for
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_metadata.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_metadata.cpp
new file mode 100644
index 00000000000000..e8ea31ab5a6a83
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_metadata.cpp
@@ -0,0 +1,67 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#include
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_metadata.h"
+
+// some of these functions can be so large that the compiler gives up optimizing
+// them - and issues a warning which may be treated as an error!
+//
+// these functions are so rarely called that it is probably okay for them not to
+// be optimized in practice
+FOLLY_CLANG_DISABLE_WARNING("-Wignored-optimization-argument")
+
+namespace apache {
+namespace thrift {
+namespace detail {
+namespace md {
+using ThriftMetadata = ::apache::thrift::metadata::ThriftMetadata;
+using ThriftPrimitiveType = ::apache::thrift::metadata::ThriftPrimitiveType;
+using ThriftType = ::apache::thrift::metadata::ThriftType;
+using ThriftService = ::apache::thrift::metadata::ThriftService;
+using ThriftServiceContext = ::apache::thrift::metadata::ThriftServiceContext;
+using ThriftFunctionGenerator = void (*)(ThriftMetadata&, ThriftService&);
+
+
+const ::apache::thrift::metadata::ThriftStruct&
+StructMetadata<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::gen(ThriftMetadata& metadata) {
+ auto res = metadata.structs()->emplace("module.EmptyStruct", ::apache::thrift::metadata::ThriftStruct{});
+ if (!res.second) {
+ return res.first->second;
+ }
+ ::apache::thrift::metadata::ThriftStruct& module_EmptyStruct = res.first->second;
+ module_EmptyStruct.name() = "module.EmptyStruct";
+ module_EmptyStruct.is_union() = false;
+ return res.first->second;
+}
+const ::apache::thrift::metadata::ThriftStruct&
+StructMetadata<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::gen(ThriftMetadata& metadata) {
+ auto res = metadata.structs()->emplace("module.TestStruct", ::apache::thrift::metadata::ThriftStruct{});
+ if (!res.second) {
+ return res.first->second;
+ }
+ ::apache::thrift::metadata::ThriftStruct& module_TestStruct = res.first->second;
+ module_TestStruct.name() = "module.TestStruct";
+ module_TestStruct.is_union() = false;
+ static const auto* const
+ module_TestStruct_fields = new std::array{ {
+ { 1, "unqualified_int_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 2, "unqualified_bool_field", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 3, "unqualified_list_field", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 4, "unqualified_struct_field", false, std::make_unique>("module.EmptyStruct"), std::vector{ }}, { 5, "optional_int_field", true, std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE), std::vector{ }}, { 6, "optional_bool_field", true, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{ }}, { 7, "optional_list_field", true, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_I32_TYPE)), std::vector{ }}, { 8, "optional_struct_field", true, std::make_unique>("module.EmptyStruct"), std::vector{ }}, }};
+ for (const auto& f : *module_TestStruct_fields) {
+ ::apache::thrift::metadata::ThriftField field;
+ field.id() = f.id;
+ field.name() = f.name;
+ field.is_optional() = f.is_optional;
+ f.metadata_type_interface->writeAndGenType(*field.type(), metadata);
+ field.structured_annotations() = f.structured_annotations;
+ module_TestStruct.fields()->push_back(std::move(field));
+ }
+ return res.first->second;
+}
+
+} // namespace md
+} // namespace detail
+} // namespace thrift
+} // namespace apache
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_metadata.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_metadata.h
new file mode 100644
index 00000000000000..fc03367c2059a5
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_metadata.h
@@ -0,0 +1,33 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
+#include
+
+#include
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_types.h"
+
+
+namespace apache {
+namespace thrift {
+namespace detail {
+namespace md {
+
+template <>
+class StructMetadata<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct> {
+ public:
+ static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata);
+};
+template <>
+class StructMetadata<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct> {
+ public:
+ static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata);
+};
+} // namespace md
+} // namespace detail
+} // namespace thrift
+} // namespace apache
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_types.cpp b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_types.cpp
new file mode 100644
index 00000000000000..55903afcf250b0
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_types.cpp
@@ -0,0 +1,329 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_types.h"
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_types.tcc"
+
+#include
+
+#include "thrift/compiler/test/fixtures/default_values_rectification_after/gen-cpp2/module_data.h"
+[[maybe_unused]] static constexpr std::string_view kModuleName = "module";
+
+
+namespace apache {
+namespace thrift {
+namespace detail {
+
+void TccStructTraits<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>::translateFieldName(
+ std::string_view _fname,
+ int16_t& fid,
+ apache::thrift::protocol::TType& _ftype) noexcept {
+ using data = apache::thrift::TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>;
+ static const st::translate_field_name_table table{
+ data::fields_size,
+ data::fields_names.data(),
+ data::fields_ids.data(),
+ data::fields_types.data()};
+ st::translate_field_name(_fname, fid, _ftype, table);
+}
+
+} // namespace detail
+} // namespace thrift
+} // namespace apache
+
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification {
+
+const char* EmptyStruct::__fbthrift_thrift_uri() {
+ return "facebook.com/thrift/compiler/test/fixtures/default_values_rectification/EmptyStruct";
+}
+
+std::string_view EmptyStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
+ if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
+ return apache::thrift::TStructDataStorage::fields_names[folly::to_underlying(ord) - 1];
+}
+std::string_view EmptyStruct::__fbthrift_get_class_name() {
+ return apache::thrift::TStructDataStorage::name;
+}
+
+
+EmptyStruct::EmptyStruct(apache::thrift::FragileConstructor) {}
+
+
+void EmptyStruct::__fbthrift_clear() {
+ // clear all fields
+}
+
+void EmptyStruct::__fbthrift_clear_terse_fields() {
+}
+
+bool EmptyStruct::__fbthrift_is_empty() const {
+ return true;
+}
+
+bool EmptyStruct::operator==([[maybe_unused]] const EmptyStruct& rhs) const {
+ return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
+}
+
+bool EmptyStruct::operator<([[maybe_unused]] const EmptyStruct& rhs) const {
+ return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
+}
+
+
+void swap([[maybe_unused]] EmptyStruct& a, [[maybe_unused]] EmptyStruct& b) {
+ using ::std::swap;
+}
+
+template void EmptyStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
+template uint32_t EmptyStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
+template uint32_t EmptyStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
+template uint32_t EmptyStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
+template void EmptyStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
+template uint32_t EmptyStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
+template uint32_t EmptyStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
+template uint32_t EmptyStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
+
+
+} // namespace facebook::thrift::compiler::test::fixtures::default_values_rectification
+
+namespace apache {
+namespace thrift {
+namespace detail {
+
+void TccStructTraits<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>::translateFieldName(
+ std::string_view _fname,
+ int16_t& fid,
+ apache::thrift::protocol::TType& _ftype) noexcept {
+ using data = apache::thrift::TStructDataStorage<::facebook::thrift::compiler::test::fixtures::default_values_rectification::TestStruct>;
+ static const st::translate_field_name_table table{
+ data::fields_size,
+ data::fields_names.data(),
+ data::fields_ids.data(),
+ data::fields_types.data()};
+ st::translate_field_name(_fname, fid, _ftype, table);
+}
+
+} // namespace detail
+} // namespace thrift
+} // namespace apache
+
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification {
+
+const char* TestStruct::__fbthrift_thrift_uri() {
+ return "facebook.com/thrift/compiler/test/fixtures/default_values_rectification/TestStruct";
+}
+
+std::string_view TestStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
+ if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
+ return apache::thrift::TStructDataStorage::fields_names[folly::to_underlying(ord) - 1];
+}
+std::string_view TestStruct::__fbthrift_get_class_name() {
+ return apache::thrift::TStructDataStorage::name;
+}
+
+TestStruct::TestStruct(const TestStruct&) = default;
+TestStruct& TestStruct::operator=(const TestStruct&) = default;
+TestStruct::TestStruct() :
+ __fbthrift_field_unqualified_int_field(),
+ __fbthrift_field_unqualified_bool_field(),
+ __fbthrift_field_optional_int_field(),
+ __fbthrift_field_optional_bool_field() {
+}
+
+
+TestStruct::~TestStruct() {}
+
+TestStruct::TestStruct([[maybe_unused]] TestStruct&& other) noexcept :
+ __fbthrift_field_unqualified_int_field(std::move(other.__fbthrift_field_unqualified_int_field)),
+ __fbthrift_field_unqualified_bool_field(std::move(other.__fbthrift_field_unqualified_bool_field)),
+ __fbthrift_field_unqualified_list_field(std::move(other.__fbthrift_field_unqualified_list_field)),
+ __fbthrift_field_unqualified_struct_field(std::move(other.__fbthrift_field_unqualified_struct_field)),
+ __fbthrift_field_optional_int_field(std::move(other.__fbthrift_field_optional_int_field)),
+ __fbthrift_field_optional_bool_field(std::move(other.__fbthrift_field_optional_bool_field)),
+ __fbthrift_field_optional_list_field(std::move(other.__fbthrift_field_optional_list_field)),
+ __fbthrift_field_optional_struct_field(std::move(other.__fbthrift_field_optional_struct_field)),
+ __isset(other.__isset) {
+}
+
+TestStruct& TestStruct::operator=([[maybe_unused]] TestStruct&& other) noexcept {
+ this->__fbthrift_field_unqualified_int_field = std::move(other.__fbthrift_field_unqualified_int_field);
+ this->__fbthrift_field_unqualified_bool_field = std::move(other.__fbthrift_field_unqualified_bool_field);
+ this->__fbthrift_field_unqualified_list_field = std::move(other.__fbthrift_field_unqualified_list_field);
+ this->__fbthrift_field_unqualified_struct_field = std::move(other.__fbthrift_field_unqualified_struct_field);
+ this->__fbthrift_field_optional_int_field = std::move(other.__fbthrift_field_optional_int_field);
+ this->__fbthrift_field_optional_bool_field = std::move(other.__fbthrift_field_optional_bool_field);
+ this->__fbthrift_field_optional_list_field = std::move(other.__fbthrift_field_optional_list_field);
+ this->__fbthrift_field_optional_struct_field = std::move(other.__fbthrift_field_optional_struct_field);
+ __isset = other.__isset;
+ return *this;
+}
+
+
+TestStruct::TestStruct(apache::thrift::FragileConstructor, ::std::int32_t unqualified_int_field__arg, bool unqualified_bool_field__arg, ::std::vector<::std::int32_t> unqualified_list_field__arg, ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct unqualified_struct_field__arg, ::std::int32_t optional_int_field__arg, bool optional_bool_field__arg, ::std::vector<::std::int32_t> optional_list_field__arg, ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct optional_struct_field__arg) :
+ __fbthrift_field_unqualified_int_field(std::move(unqualified_int_field__arg)),
+ __fbthrift_field_unqualified_bool_field(std::move(unqualified_bool_field__arg)),
+ __fbthrift_field_unqualified_list_field(std::move(unqualified_list_field__arg)),
+ __fbthrift_field_unqualified_struct_field(std::move(unqualified_struct_field__arg)),
+ __fbthrift_field_optional_int_field(std::move(optional_int_field__arg)),
+ __fbthrift_field_optional_bool_field(std::move(optional_bool_field__arg)),
+ __fbthrift_field_optional_list_field(std::move(optional_list_field__arg)),
+ __fbthrift_field_optional_struct_field(std::move(optional_struct_field__arg)) {
+ __isset.set(folly::index_constant<0>(), true);
+ __isset.set(folly::index_constant<1>(), true);
+ __isset.set(folly::index_constant<2>(), true);
+ __isset.set(folly::index_constant<3>(), true);
+ __isset.set(folly::index_constant<4>(), true);
+ __isset.set(folly::index_constant<5>(), true);
+ __isset.set(folly::index_constant<6>(), true);
+ __isset.set(folly::index_constant<7>(), true);
+}
+
+
+void TestStruct::__fbthrift_clear() {
+ // clear all fields
+ this->__fbthrift_field_unqualified_int_field = ::std::int32_t();
+ this->__fbthrift_field_unqualified_bool_field = bool();
+ this->__fbthrift_field_unqualified_list_field.clear();
+ this->__fbthrift_field_optional_int_field = ::std::int32_t();
+ this->__fbthrift_field_optional_bool_field = bool();
+ this->__fbthrift_field_optional_list_field.clear();
+ __isset = {};
+}
+
+void TestStruct::__fbthrift_clear_terse_fields() {
+}
+
+bool TestStruct::__fbthrift_is_empty() const {
+ return false;
+}
+
+bool TestStruct::operator==([[maybe_unused]] const TestStruct& rhs) const {
+ return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
+}
+
+bool TestStruct::operator<([[maybe_unused]] const TestStruct& rhs) const {
+ return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
+}
+
+
+::std::int32_t TestStruct::get_unqualified_int_field() const {
+ return __fbthrift_field_unqualified_int_field;
+}
+
+::std::int32_t& TestStruct::set_unqualified_int_field(::std::int32_t unqualified_int_field_) {
+ unqualified_int_field_ref() = unqualified_int_field_;
+ return __fbthrift_field_unqualified_int_field;
+}
+
+bool TestStruct::get_unqualified_bool_field() const {
+ return __fbthrift_field_unqualified_bool_field;
+}
+
+bool& TestStruct::set_unqualified_bool_field(bool unqualified_bool_field_) {
+ unqualified_bool_field_ref() = unqualified_bool_field_;
+ return __fbthrift_field_unqualified_bool_field;
+}
+
+const ::std::vector<::std::int32_t>& TestStruct::get_unqualified_list_field() const& {
+ return __fbthrift_field_unqualified_list_field;
+}
+
+::std::vector<::std::int32_t> TestStruct::get_unqualified_list_field() && {
+ return static_cast<::std::vector<::std::int32_t>&&>(__fbthrift_field_unqualified_list_field);
+}
+
+const ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct& TestStruct::get_unqualified_struct_field() const& {
+ return __fbthrift_field_unqualified_struct_field;
+}
+
+::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct TestStruct::get_unqualified_struct_field() && {
+ return static_cast<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct&&>(__fbthrift_field_unqualified_struct_field);
+}
+
+const ::std::int32_t* TestStruct::get_optional_int_field() const& {
+ return optional_int_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_int_field) : nullptr;
+}
+
+::std::int32_t* TestStruct::get_optional_int_field() & {
+ return optional_int_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_int_field) : nullptr;
+}
+
+::std::int32_t& TestStruct::set_optional_int_field(::std::int32_t optional_int_field_) {
+ optional_int_field_ref() = optional_int_field_;
+ return __fbthrift_field_optional_int_field;
+}
+
+const bool* TestStruct::get_optional_bool_field() const& {
+ return optional_bool_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_bool_field) : nullptr;
+}
+
+bool* TestStruct::get_optional_bool_field() & {
+ return optional_bool_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_bool_field) : nullptr;
+}
+
+bool& TestStruct::set_optional_bool_field(bool optional_bool_field_) {
+ optional_bool_field_ref() = optional_bool_field_;
+ return __fbthrift_field_optional_bool_field;
+}
+
+const ::std::vector<::std::int32_t>* TestStruct::get_optional_list_field() const& {
+ return optional_list_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_list_field) : nullptr;
+}
+
+::std::vector<::std::int32_t>* TestStruct::get_optional_list_field() & {
+ return optional_list_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_list_field) : nullptr;
+}
+
+const ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct* TestStruct::get_optional_struct_field() const& {
+ return optional_struct_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_struct_field) : nullptr;
+}
+
+::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct* TestStruct::get_optional_struct_field() & {
+ return optional_struct_field_ref().has_value() ? std::addressof(__fbthrift_field_optional_struct_field) : nullptr;
+}
+
+void swap([[maybe_unused]] TestStruct& a, [[maybe_unused]] TestStruct& b) {
+ using ::std::swap;
+ swap(a.__fbthrift_field_unqualified_int_field, b.__fbthrift_field_unqualified_int_field);
+ swap(a.__fbthrift_field_unqualified_bool_field, b.__fbthrift_field_unqualified_bool_field);
+ swap(a.__fbthrift_field_unqualified_list_field, b.__fbthrift_field_unqualified_list_field);
+ swap(a.__fbthrift_field_unqualified_struct_field, b.__fbthrift_field_unqualified_struct_field);
+ swap(a.__fbthrift_field_optional_int_field, b.__fbthrift_field_optional_int_field);
+ swap(a.__fbthrift_field_optional_bool_field, b.__fbthrift_field_optional_bool_field);
+ swap(a.__fbthrift_field_optional_list_field, b.__fbthrift_field_optional_list_field);
+ swap(a.__fbthrift_field_optional_struct_field, b.__fbthrift_field_optional_struct_field);
+ swap(a.__isset, b.__isset);
+}
+
+template void TestStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
+template uint32_t TestStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
+template uint32_t TestStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
+template uint32_t TestStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
+template void TestStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
+template uint32_t TestStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
+template uint32_t TestStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
+template uint32_t TestStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
+
+static_assert(
+ ::apache::thrift::detail::st::gen_check_json<
+ TestStruct,
+ ::apache::thrift::type_class::structure,
+ ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>,
+ "inconsistent use of json option");
+static_assert(
+ ::apache::thrift::detail::st::gen_check_json<
+ TestStruct,
+ ::apache::thrift::type_class::structure,
+ ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>,
+ "inconsistent use of json option");
+
+} // namespace facebook::thrift::compiler::test::fixtures::default_values_rectification
+
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification { namespace {
+[[maybe_unused]] FOLLY_ERASE void validateAdapters() {
+}
+}} // namespace facebook::thrift::compiler::test::fixtures::default_values_rectification
+namespace apache::thrift::detail::annotation {
+}
diff --git a/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_types.h b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_types.h
new file mode 100644
index 00000000000000..8a5fb161e65eb9
--- /dev/null
+++ b/third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/out/cpp2/gen-cpp2/module_types.h
@@ -0,0 +1,818 @@
+/**
+ * Autogenerated by Thrift for thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated @nocommit
+ */
+#pragma once
+
+#include
+
+
+
+namespace apache {
+namespace thrift {
+namespace ident {
+struct unqualified_int_field;
+struct unqualified_bool_field;
+struct unqualified_list_field;
+struct unqualified_struct_field;
+struct optional_int_field;
+struct optional_bool_field;
+struct optional_list_field;
+struct optional_struct_field;
+} // namespace ident
+namespace detail {
+#ifndef APACHE_THRIFT_ACCESSOR_unqualified_int_field
+#define APACHE_THRIFT_ACCESSOR_unqualified_int_field
+APACHE_THRIFT_DEFINE_ACCESSOR(unqualified_int_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_unqualified_bool_field
+#define APACHE_THRIFT_ACCESSOR_unqualified_bool_field
+APACHE_THRIFT_DEFINE_ACCESSOR(unqualified_bool_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_unqualified_list_field
+#define APACHE_THRIFT_ACCESSOR_unqualified_list_field
+APACHE_THRIFT_DEFINE_ACCESSOR(unqualified_list_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_unqualified_struct_field
+#define APACHE_THRIFT_ACCESSOR_unqualified_struct_field
+APACHE_THRIFT_DEFINE_ACCESSOR(unqualified_struct_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_optional_int_field
+#define APACHE_THRIFT_ACCESSOR_optional_int_field
+APACHE_THRIFT_DEFINE_ACCESSOR(optional_int_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_optional_bool_field
+#define APACHE_THRIFT_ACCESSOR_optional_bool_field
+APACHE_THRIFT_DEFINE_ACCESSOR(optional_bool_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_optional_list_field
+#define APACHE_THRIFT_ACCESSOR_optional_list_field
+APACHE_THRIFT_DEFINE_ACCESSOR(optional_list_field);
+#endif
+#ifndef APACHE_THRIFT_ACCESSOR_optional_struct_field
+#define APACHE_THRIFT_ACCESSOR_optional_struct_field
+APACHE_THRIFT_DEFINE_ACCESSOR(optional_struct_field);
+#endif
+} // namespace detail
+} // namespace thrift
+} // namespace apache
+
+// BEGIN declare_enums
+
+// END declare_enums
+// BEGIN forward_declare
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification {
+class EmptyStruct;
+class TestStruct;
+} // namespace facebook::thrift::compiler::test::fixtures::default_values_rectification
+// END forward_declare
+namespace apache::thrift::detail::annotation {
+} // namespace apache::thrift::detail::annotation
+
+namespace apache::thrift::detail::qualifier {
+} // namespace apache::thrift::detail::qualifier
+
+// BEGIN hash_and_equal_to
+// END hash_and_equal_to
+namespace facebook::thrift::compiler::test::fixtures::default_values_rectification {
+using ::apache::thrift::detail::operator!=;
+using ::apache::thrift::detail::operator>;
+using ::apache::thrift::detail::operator<=;
+using ::apache::thrift::detail::operator>=;
+
+
+/** Glean {"file": "thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift", "name": "EmptyStruct", "kind": "struct" } */
+class EmptyStruct final {
+ private:
+ friend struct ::apache::thrift::detail::st::struct_private_access;
+ template friend struct ::apache::thrift::detail::invoke_reffer;
+
+ // used by a static_assert in the corresponding source
+ static constexpr bool __fbthrift_cpp2_gen_json = false;
+ static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
+ static const char* __fbthrift_thrift_uri();
+ static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
+ static std::string_view __fbthrift_get_class_name();
+ template
+ FOLLY_ERASE static constexpr std::string_view __fbthrift_get_module_name() noexcept {
+ return "module";
+ }
+ using __fbthrift_reflection_ident_list = folly::tag_t<
+ >;
+
+ static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0};
+ using __fbthrift_reflection_type_tags = folly::tag_t<
+ >;
+
+ static constexpr std::size_t __fbthrift_field_size_v = 0;
+
+ template
+ using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;
+
+ template
+ using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;
+
+ template
+ using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;
+
+ template using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
+ ::apache::thrift::detail::getFieldOrdinal(
+ __fbthrift_reflection_field_id_list
+ )
+ >;
+ void __fbthrift_clear();
+ void __fbthrift_clear_terse_fields();
+ bool __fbthrift_is_empty() const;
+
+ public:
+ using __fbthrift_cpp2_type = EmptyStruct;
+ static constexpr bool __fbthrift_cpp2_is_union =
+ false;
+ static constexpr bool __fbthrift_cpp2_uses_op_encode =
+ false;
+
+
+ public:
+
+ EmptyStruct() {
+ }
+ // FragileConstructor for use in initialization lists only.
+ [[deprecated("This constructor is deprecated")]]
+ EmptyStruct(apache::thrift::FragileConstructor);
+
+ EmptyStruct(EmptyStruct&&) = default;
+
+ EmptyStruct(const EmptyStruct&) = default;
+
+
+ EmptyStruct& operator=(EmptyStruct&&) = default;
+
+ EmptyStruct& operator=(const EmptyStruct&) = default;
+
+ public:
+
+ bool operator==(const EmptyStruct&) const;
+ bool operator<(const EmptyStruct&) const;
+
+ template
+ unsigned long read(Protocol_* iprot);
+ template
+ uint32_t serializedSize(Protocol_ const* prot_) const;
+ template
+ uint32_t serializedSizeZC(Protocol_ const* prot_) const;
+ template
+ uint32_t write(Protocol_* prot_) const;
+
+ private:
+ template
+ void readNoXfer(Protocol_* iprot);
+
+ friend class ::apache::thrift::Cpp2Ops;
+ friend void swap(EmptyStruct& a, EmptyStruct& b);
+};
+
+template
+unsigned long EmptyStruct::read(Protocol_* iprot) {
+ auto _xferStart = iprot->getCursorPosition();
+ readNoXfer(iprot);
+ return iprot->getCursorPosition() - _xferStart;
+}
+
+
+/** Glean {"file": "thrift/compiler/test/fixtures/default_values_rectification_after/src/module.thrift", "name": "TestStruct", "kind": "struct" } */
+class TestStruct final {
+ private:
+ friend struct ::apache::thrift::detail::st::struct_private_access;
+ template friend struct ::apache::thrift::detail::invoke_reffer;
+
+ // used by a static_assert in the corresponding source
+ static constexpr bool __fbthrift_cpp2_gen_json = false;
+ static constexpr bool __fbthrift_cpp2_is_runtime_annotation = false;
+ static const char* __fbthrift_thrift_uri();
+ static std::string_view __fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord);
+ static std::string_view __fbthrift_get_class_name();
+ template
+ FOLLY_ERASE static constexpr std::string_view __fbthrift_get_module_name() noexcept {
+ return "module";
+ }
+ using __fbthrift_reflection_ident_list = folly::tag_t<
+ ::apache::thrift::ident::unqualified_int_field,
+ ::apache::thrift::ident::unqualified_bool_field,
+ ::apache::thrift::ident::unqualified_list_field,
+ ::apache::thrift::ident::unqualified_struct_field,
+ ::apache::thrift::ident::optional_int_field,
+ ::apache::thrift::ident::optional_bool_field,
+ ::apache::thrift::ident::optional_list_field,
+ ::apache::thrift::ident::optional_struct_field
+ >;
+
+ static constexpr std::int16_t __fbthrift_reflection_field_id_list[] = {0,1,2,3,4,5,6,7,8};
+ using __fbthrift_reflection_type_tags = folly::tag_t<
+ ::apache::thrift::type::i32_t,
+ ::apache::thrift::type::bool_t,
+ ::apache::thrift::type::list<::apache::thrift::type::i32_t>,
+ ::apache::thrift::type::struct_t<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>,
+ ::apache::thrift::type::i32_t,
+ ::apache::thrift::type::bool_t,
+ ::apache::thrift::type::list<::apache::thrift::type::i32_t>,
+ ::apache::thrift::type::struct_t<::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct>
+ >;
+
+ static constexpr std::size_t __fbthrift_field_size_v = 8;
+
+ template
+ using __fbthrift_id = ::apache::thrift::type::field_id<__fbthrift_reflection_field_id_list[folly::to_underlying(T::value)]>;
+
+ template
+ using __fbthrift_type_tag = ::apache::thrift::detail::at<__fbthrift_reflection_type_tags, T::value>;
+
+ template
+ using __fbthrift_ident = ::apache::thrift::detail::at<__fbthrift_reflection_ident_list, T::value>;
+
+ template using __fbthrift_ordinal = ::apache::thrift::type::ordinal_tag<
+ ::apache::thrift::detail::getFieldOrdinal(
+ __fbthrift_reflection_field_id_list
+ )
+ >;
+ void __fbthrift_clear();
+ void __fbthrift_clear_terse_fields();
+ bool __fbthrift_is_empty() const;
+
+ public:
+ using __fbthrift_cpp2_type = TestStruct;
+ static constexpr bool __fbthrift_cpp2_is_union =
+ false;
+ static constexpr bool __fbthrift_cpp2_uses_op_encode =
+ false;
+
+
+ public:
+
+ TestStruct();
+
+ // FragileConstructor for use in initialization lists only.
+ [[deprecated("This constructor is deprecated")]]
+ TestStruct(apache::thrift::FragileConstructor, ::std::int32_t unqualified_int_field__arg, bool unqualified_bool_field__arg, ::std::vector<::std::int32_t> unqualified_list_field__arg, ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct unqualified_struct_field__arg, ::std::int32_t optional_int_field__arg, bool optional_bool_field__arg, ::std::vector<::std::int32_t> optional_list_field__arg, ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct optional_struct_field__arg);
+
+ TestStruct(TestStruct&&) noexcept;
+
+ TestStruct(const TestStruct& src);
+
+
+ TestStruct& operator=(TestStruct&&) noexcept;
+ TestStruct& operator=(const TestStruct& src);
+
+ ~TestStruct();
+
+ private:
+ ::std::int32_t __fbthrift_field_unqualified_int_field;
+ private:
+ bool __fbthrift_field_unqualified_bool_field;
+ private:
+ ::std::vector<::std::int32_t> __fbthrift_field_unqualified_list_field;
+ private:
+ ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct __fbthrift_field_unqualified_struct_field;
+ private:
+ ::std::int32_t __fbthrift_field_optional_int_field;
+ private:
+ bool __fbthrift_field_optional_bool_field;
+ private:
+ ::std::vector<::std::int32_t> __fbthrift_field_optional_list_field;
+ private:
+ ::facebook::thrift::compiler::test::fixtures::default_values_rectification::EmptyStruct __fbthrift_field_optional_struct_field;
+ private:
+ apache::thrift::detail::isset_bitset<8, apache::thrift::detail::IssetBitsetOption::Unpacked> __isset;
+
+ public:
+
+ bool operator==(const TestStruct&) const;
+ bool operator<(const TestStruct&) const;
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field_ref() const& {
+ return {this->__fbthrift_field_unqualified_int_field, __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_int_field), __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field_ref() & {
+ return {this->__fbthrift_field_unqualified_int_field, __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field_ref() && {
+ return {static_cast(this->__fbthrift_field_unqualified_int_field), __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field() const& {
+ return {this->__fbthrift_field_unqualified_int_field, __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_int_field), __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field() & {
+ return {this->__fbthrift_field_unqualified_int_field, __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_int_field() && {
+ return {static_cast(this->__fbthrift_field_unqualified_int_field), __isset.at(0), __isset.bit(0)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field_ref() const& {
+ return {this->__fbthrift_field_unqualified_bool_field, __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_bool_field), __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field_ref() & {
+ return {this->__fbthrift_field_unqualified_bool_field, __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field_ref() && {
+ return {static_cast(this->__fbthrift_field_unqualified_bool_field), __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field() const& {
+ return {this->__fbthrift_field_unqualified_bool_field, __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_bool_field), __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field() & {
+ return {this->__fbthrift_field_unqualified_bool_field, __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_bool_field() && {
+ return {static_cast(this->__fbthrift_field_unqualified_bool_field), __isset.at(1), __isset.bit(1)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field_ref() const& {
+ return {this->__fbthrift_field_unqualified_list_field, __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_list_field), __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field_ref() & {
+ return {this->__fbthrift_field_unqualified_list_field, __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field_ref() && {
+ return {static_cast(this->__fbthrift_field_unqualified_list_field), __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field() const& {
+ return {this->__fbthrift_field_unqualified_list_field, __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_list_field), __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field() & {
+ return {this->__fbthrift_field_unqualified_list_field, __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_list_field() && {
+ return {static_cast(this->__fbthrift_field_unqualified_list_field), __isset.at(2), __isset.bit(2)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field_ref() const& {
+ return {this->__fbthrift_field_unqualified_struct_field, __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_struct_field), __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field_ref() & {
+ return {this->__fbthrift_field_unqualified_struct_field, __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field_ref() && {
+ return {static_cast(this->__fbthrift_field_unqualified_struct_field), __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field() const& {
+ return {this->__fbthrift_field_unqualified_struct_field, __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field() const&& {
+ return {static_cast(this->__fbthrift_field_unqualified_struct_field), __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field() & {
+ return {this->__fbthrift_field_unqualified_struct_field, __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "unqualified_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::field_ref unqualified_struct_field() && {
+ return {static_cast(this->__fbthrift_field_unqualified_struct_field), __isset.at(3), __isset.bit(3)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field_ref() const& {
+ return {this->__fbthrift_field_optional_int_field, __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_optional_int_field), __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field_ref() & {
+ return {this->__fbthrift_field_optional_int_field, __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field_ref() && {
+ return {static_cast(this->__fbthrift_field_optional_int_field), __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field() const& {
+ return {this->__fbthrift_field_optional_int_field, __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field() const&& {
+ return {static_cast(this->__fbthrift_field_optional_int_field), __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field() & {
+ return {this->__fbthrift_field_optional_int_field, __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_int_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_int_field() && {
+ return {static_cast(this->__fbthrift_field_optional_int_field), __isset.at(4), __isset.bit(4)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field_ref() const& {
+ return {this->__fbthrift_field_optional_bool_field, __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_optional_bool_field), __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field_ref() & {
+ return {this->__fbthrift_field_optional_bool_field, __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field_ref() && {
+ return {static_cast(this->__fbthrift_field_optional_bool_field), __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field() const& {
+ return {this->__fbthrift_field_optional_bool_field, __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field() const&& {
+ return {static_cast(this->__fbthrift_field_optional_bool_field), __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field() & {
+ return {this->__fbthrift_field_optional_bool_field, __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_bool_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_bool_field() && {
+ return {static_cast(this->__fbthrift_field_optional_bool_field), __isset.at(5), __isset.bit(5)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field_ref() const& {
+ return {this->__fbthrift_field_optional_list_field, __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field_ref() const&& {
+ return {static_cast(this->__fbthrift_field_optional_list_field), __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field_ref() & {
+ return {this->__fbthrift_field_optional_list_field, __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field_ref() && {
+ return {static_cast(this->__fbthrift_field_optional_list_field), __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field() const& {
+ return {this->__fbthrift_field_optional_list_field, __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field() const&& {
+ return {static_cast(this->__fbthrift_field_optional_list_field), __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field() & {
+ return {this->__fbthrift_field_optional_list_field, __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_list_field" } */
+ template >
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_list_field() && {
+ return {static_cast(this->__fbthrift_field_optional_list_field), __isset.at(6), __isset.bit(6)};
+ }
+
+ /** Glean { "field": "optional_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_struct_field_ref() const& {
+ return {this->__fbthrift_field_optional_struct_field, __isset.at(7), __isset.bit(7)};
+ }
+
+ /** Glean { "field": "optional_struct_field" } */
+ template
+ FOLLY_ERASE ::apache::thrift::optional_field_ref optional_struct_field_ref() const&& {
+ return {static_cast