Allow non-optional boxed fields.
commit344c9d33e279d055e49ceab19e4621ba93b54bf4
authorDave Kwon <dokwon@meta.com>
Tue, 4 Oct 2022 19:45:16 +0000 (4 12:45 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 4 Oct 2022 19:45:16 +0000 (4 12:45 -0700)
treed95ea456d5b6aea28f1f8204c554a826915a94f0
parent925648769441c7ed31d84c28d0566e9dc1b1df76
Allow non-optional boxed fields.

Summary: Non-optional boxed fields behave similar to non-optional cpp.ref fields. We assume that the field is never null :)

Reviewed By: Alfus

Differential Revision: D40045726

fbshipit-source-id: 9b14b7ef1407912daaaad5cd728ee65682bc56fe
53 files changed:
third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc
third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_types_cpp/clear_fields.mustache
third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_types_h/base_ctor_no_alloc_init_list.mustache
third-party/thrift/src/thrift/compiler/generate/templates/cpp2/module_types_h/base_ctor_with_alloc_init_list.mustache
third-party/thrift/src/thrift/compiler/sema/standard_validator.cc
third-party/thrift/src/thrift/compiler/test/compiler_failure_test.py
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-android/test/fixtures/adapter/StructWithFieldAdapter.java
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_data.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_data.h
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_for_each_field.h
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_metadata.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_types.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_types.h
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_types.tcc
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-cpp2/module_visit_by_thrift_field_metadata.h
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-go/module/ttypes.go
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-hack/module_types.php
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-java/test/fixtures/adapter/StructWithFieldAdapter.java
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-javadeprecated/test/fixtures/adapter/StructWithFieldAdapter.java
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-json/module.json
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-py/module/ttypes.py
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-py/module/ttypes.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-py3/module/types.h
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-rust/types.rs
third-party/thrift/src/thrift/compiler/test/fixtures/adapter/src/module.thrift
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-android/StructWithNonOptionalBox.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_data.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_data.h
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_for_each_field.h
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_metadata.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_metadata.h
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_types.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_types.h
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_types.tcc
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-cpp2/module_visit_by_thrift_field_metadata.h
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-java/test/fixtures/refs/StructWithNonOptionalBox.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-javadeprecated/StructWithNonOptionalBox.java [new file with mode: 0644]
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/builders.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/builders.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/builders.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/metadata.cpp
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types.h
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types.pyi
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types_fields.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types_fields.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types_reflection.pxd
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-py3/module/types_reflection.pyx
third-party/thrift/src/thrift/compiler/test/fixtures/refs/gen-rust/types.rs
third-party/thrift/src/thrift/compiler/test/fixtures/refs/src/module.thrift
third-party/thrift/src/thrift/test/References.thrift
third-party/thrift/src/thrift/test/ReferencesCpp2Test.cpp