|
|
@ -1181,14 +1181,6 @@ absl::Status ParseField(JsonLexer& lex, const Desc<Traits>& desc, |
|
|
|
if (absl::StartsWith(name, "[") && absl::EndsWith(name, "]")) { |
|
|
|
if (absl::StartsWith(name, "[") && absl::EndsWith(name, "]")) { |
|
|
|
absl::string_view extn_name = name.substr(1, name.size() - 2); |
|
|
|
absl::string_view extn_name = name.substr(1, name.size() - 2); |
|
|
|
field = Traits::ExtensionByName(desc, extn_name); |
|
|
|
field = Traits::ExtensionByName(desc, extn_name); |
|
|
|
|
|
|
|
|
|
|
|
auto correct_type_name = Traits::TypeName(desc); |
|
|
|
|
|
|
|
if (Traits::TypeName(Traits::ContainingType(*field)) != correct_type_name) { |
|
|
|
|
|
|
|
return lex.Invalid(absl::StrFormat( |
|
|
|
|
|
|
|
"'%s' is a known extension name, but is not an extenion " |
|
|
|
|
|
|
|
"of '%s' as expected", |
|
|
|
|
|
|
|
extn_name, correct_type_name)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
field = Traits::FieldByName(desc, name); |
|
|
|
field = Traits::FieldByName(desc, name); |
|
|
|
} |
|
|
|
} |
|
|
|