-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mergeFrom doesn't merge fields from other object #22
Comments
If |
You are trying to merge two of the same objects |
because |
message Test
{
optional string str = 11;
}
var builder = Test.builder()
builder.str = "123"
println(builder)
var build = builder.build()
println(build)
var builder2 = Test.builder()
builder2.mergeFrom(build)
var build2 = builder2.build()
println(build2)
println(build2 == build)
println(build2 == Test.builder().build())
println(build == Test.builder().build())
println(build == Test()) Log:
All ok!! |
https://github.com/alexeyxo/protobuf-swift/blob/master/src/compiler/swift_message.cc#L774-L776
given the function definition, i would expect this function to copy the fields for the "other" protobuf that is passed in.
why does it check if its the same class and then return itself? it should be the same class and then copy the attributes.
The text was updated successfully, but these errors were encountered: