diff --git a/cc/google/fhir/json_printer.cc b/cc/google/fhir/json_printer.cc index 9a45ba643..e35a6044a 100644 --- a/cc/google/fhir/json_printer.cc +++ b/cc/google/fhir/json_printer.cc @@ -218,14 +218,14 @@ class Printer { // TODO(b/148916862): Use a registry to determine the correct // ContainedResource to unpack to. - if (google::protobuf::DownCastToGenerated(proto).UnpackTo(contained.get())) { + if (google::protobuf::DownCastMessage(proto).UnpackTo(contained.get())) { return PrintContainedResource(*contained); } // If we can't unpack the Any proto as a contained resource, try to unpack // it as a contained resource `one of` field. std::optional> resource_msg = - ExtractConcreteMessage(google::protobuf::DownCastToGenerated(proto)); + ExtractConcreteMessage(google::protobuf::DownCastMessage(proto)); if (resource_msg == std::nullopt) { // Unable to extract Any proto into a concrete message. This could // happen if the proto is not a core FHIR resource. In this case we