Reading through the source, it does seem like when Compare hits UnpackAny, 
that 'GetDescriptor' check should avoid the fatal check. However, I'm 
looking at source from a contemporary git pull, and the version in my 
software may be an older one, if this is a recent change.

On Wednesday, June 7, 2017 at 5:06:37 PM UTC-4, Alex Shaver wrote:
> When I have a list of "Any"s, and I want to find if an element in the list 
> matches some other 'Any' protobuf, I try to use the 
> util::MessageDifferencer::Equals and I get errors "Comparison between two 
> messages with different descriptors." I've tried a 
> message1.GetDescriptor() == message2.GetDescriptor && MessageDifferencer.
> Equals(message1, message2)
> combination, to hopefully head that off, but I still get the same error, 
> presumably because the descriptor is getting Any's descriptor, and not the 
> descriptor of the internal message it contains.
> Is there a way to actually make this comparison work? It seems like the 
> Equals comparison should have a specific carveout for the 'Any' case to 
> begin with.

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to