|
|
|
@ -163,20 +163,24 @@ void MapFieldGenerator::DetermineForwardDeclarations( |
|
|
|
|
std::set<std::string>* fwd_decls, bool include_external_types) const { |
|
|
|
|
RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls, |
|
|
|
|
include_external_types); |
|
|
|
|
const FieldDescriptor* value_descriptor = |
|
|
|
|
descriptor_->message_type()->map_value(); |
|
|
|
|
// NOTE: Maps with values of enums don't have to worry about adding the
|
|
|
|
|
// forward declaration because `GPB*EnumDictionary` isn't generic to the
|
|
|
|
|
// specific enum (like say `NSDictionary<String, MyMessage>`) and thus doesn't
|
|
|
|
|
// reference the type in the header.
|
|
|
|
|
if (GetObjectiveCType(value_descriptor) != OBJECTIVECTYPE_MESSAGE) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const Descriptor* value_msg_descriptor = value_descriptor->message_type(); |
|
|
|
|
|
|
|
|
|
const FieldDescriptor* value_descriptor = |
|
|
|
|
descriptor_->message_type()->map_value(); |
|
|
|
|
// Within a file there is no requirement on the order of the messages, so
|
|
|
|
|
// local references need a forward declaration. External files (not WKTs),
|
|
|
|
|
// need one when requested.
|
|
|
|
|
if (GetObjectiveCType(value_descriptor) == OBJECTIVECTYPE_MESSAGE && |
|
|
|
|
((include_external_types && |
|
|
|
|
!IsProtobufLibraryBundledProtoFile(value_descriptor->file())) || |
|
|
|
|
descriptor_->file() == value_descriptor->file())) { |
|
|
|
|
if ((include_external_types && |
|
|
|
|
!IsProtobufLibraryBundledProtoFile(value_msg_descriptor->file())) || |
|
|
|
|
descriptor_->file() == value_msg_descriptor->file()) { |
|
|
|
|
const std::string& value_storage_type = |
|
|
|
|
value_field_generator_->variable("storage_type"); |
|
|
|
|
fwd_decls->insert("@class " + value_storage_type); |
|
|
|
|