ENH: start normally when deal with unknown enumeration value

Change-Id: Ibc3d47a6181528e3aa747d79ae2a436f548f05f1
(cherry picked from commit 7fc01b6f1aea831b41d5a63b3d8858de12572b65)
This commit is contained in:
zhimin.zeng 2022-11-28 09:47:19 +08:00 committed by Lane.Wei
parent 7dddb17d8a
commit 284154d053
2 changed files with 3 additions and 3 deletions

View file

@ -615,7 +615,7 @@ bool ConfigBase::set_deserialize_raw(const t_config_option_key &opt_key_src, con
if (! success && substitutions_ctxt.rule != ForwardCompatibilitySubstitutionRule::Disable &&
// Only allow substitutions of an enum value by another enum value or a boolean value with an enum value.
// That means, we expect enum values being added in the future and possibly booleans being converted to enums.
(optdef->type == coEnum || optdef->type == coBool) && ConfigHelpers::looks_like_enum_value(value)) {
(optdef->type == coEnum || optdef->type == coEnums || optdef->type == coBool) /*&& ConfigHelpers::looks_like_enum_value(value)*/) {
// Deserialize failed, try to substitute with a default value.
//assert(substitutions_ctxt.rule == ForwardCompatibilitySubstitutionRule::Enable || substitutions_ctxt.rule == ForwardCompatibilitySubstitutionRule::EnableSilent);
if (optdef->type == coBool)