mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-17 01:12:51 +00:00
internal/value: bugfix for v2 message conversion
PBValueOf returns a protoreflect.Message, not a protoreflect.ProtoMessage. Change-Id: I88ed55f52bada6fc2b29ffd63e30de09e1febe8c Reviewed-on: https://go-review.googlesource.com/c/153917 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
ae2a561335
commit
9ecf75b72e
@ -168,7 +168,7 @@ func NewLegacyConverter(t reflect.Type, k pref.Kind, w LegacyWrapper) Converter
|
||||
if v.Type() != t {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), t))
|
||||
}
|
||||
return pref.ValueOf(v.Interface())
|
||||
return pref.ValueOf(v.Interface().(pref.ProtoMessage).ProtoReflect())
|
||||
},
|
||||
GoValueOf: func(v pref.Value) reflect.Value {
|
||||
rv := reflect.ValueOf(v.Message().Interface())
|
||||
|
Loading…
Reference in New Issue
Block a user