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>
@@ -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())