reflect/protoreflect: rename methods with Type suffix
The protobuf type system uses the word "descriptor" instead of "type".
We should avoid the "type" verbage when we aren't talking about Go types.
The old names are temporarily kept around for compatibility reasons.
Change-Id: Icc99c913528ead011f7a74aa8399d9c5ec6dc56e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/172238
Reviewed-by: Herbie Ong <herbie@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/legacy/extension.go b/internal/legacy/extension.go
index 19205ea..94ad7b7 100644
--- a/internal/legacy/extension.go
+++ b/internal/legacy/extension.go
@@ -64,7 +64,7 @@
// Determine the parent type if possible.
var parent piface.MessageV1
- if mt, ok := t.ExtendedType().(pref.MessageType); ok {
+ if mt, ok := t.Extendee().(pref.MessageType); ok {
// Create a new parent message and unwrap it if possible.
mv := mt.New().Interface()
t := reflect.TypeOf(mv)
@@ -97,7 +97,7 @@
if t.Kind() == pref.EnumKind {
// Derive Go type name.
// For legacy enums, unwrap the wrapper to get the underlying Go type.
- et := t.EnumType().(pref.EnumType)
+ et := t.Enum().(pref.EnumType)
var ev interface{} = et.New(0)
if u, ok := ev.(pvalue.Unwrapper); ok {
ev = u.ProtoUnwrap()