Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warnings related to custom default values
Summary: # Changes Breakdown 1. Changes `check_initializer()` (in `check_initializer.cc`) to return a boolean indicating whether any error was detected. 2. Use newly obtained boolean value to skip further validation of custom default values (in `standard_validat.cc::validate_field_default_value()`) if the initializer is not valid to begin with 3. If the initializer is valid, issue warnings if: 1. the custom default value is the same as the intrinsic default (i.e., specifying a default value explicitly is therefore redundant). 2. the field for which an explicit default value is specified is `optional` or `terse`. * In the `optional` case, a custom default value is nonsensical: it is simply ignored. * In the `terse` case, it is undesirable because it makes the logic/optimization of terse fields much more complex than it needs to be, and in practice we've noticed that there is only a very small number of use cases of custom defaults with terse fields. Removing them would allow us to significantly improve the logic and code (and better formalize terse fields in the Thrift Object Model - and allow easier general rollout). Reviewed By: praihan, iahs Differential Revision: D68197595 fbshipit-source-id: 2db9e68620ed783164fcc0fd6880d5d085020b9f
- Loading branch information