reflect/protoreflect: remove {Enum,Message}.Type methods
This is a breaking change in light of new methods added in CL/174918.
This removes:
Enum.Type: replacement is Descriptor
Message.Type: replacement is Descriptor and New
Change-Id: Iaa5328795407c8401ef14ed038bd5ace19d8e03b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/174938
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/cmd/protoc-gen-go/internal_gengo/reflect.go b/cmd/protoc-gen-go/internal_gengo/reflect.go
index d1dbc03..53d7c96 100644
--- a/cmd/protoc-gen-go/internal_gengo/reflect.go
+++ b/cmd/protoc-gen-go/internal_gengo/reflect.go
@@ -239,14 +239,6 @@
g.P("}")
g.P()
- // Type method.
- // TODO: Remove this.
- g.P("// Deprecated: Use Descriptor instead.")
- g.P("func (", enum.GoIdent, ") Type() ", protoreflectPackage.Ident("EnumType"), " {")
- g.P("return ", typesVar, "[", idx, "]")
- g.P("}")
- g.P()
-
// Number method.
g.P("func (x ", enum.GoIdent, ") Number() ", protoreflectPackage.Ident("EnumNumber"), " {")
g.P("return ", protoreflectPackage.Ident("EnumNumber"), "(x)")
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
index 855a52b..1759e76 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
+++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
@@ -48,11 +48,6 @@
return file_annotations_annotations_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (AnnotationsTestEnum) Type() protoreflect.EnumType {
- return file_annotations_annotations_proto_enumTypes[0]
-}
-
func (x AnnotationsTestEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
index b69fec2..1a979ed 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
+++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
@@ -1 +1 @@
-annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:639 end:658} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:675 end:722} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:2103 end:2125} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2136 end:2156} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:3177 end:3200}
\ No newline at end of file
+annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:639 end:658} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:675 end:722} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1947 end:1969} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1980 end:2000} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:3021 end:3044}
\ No newline at end of file
diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
index c7058d9..b19b6d0 100644
--- a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
@@ -47,11 +47,6 @@
return file_comments_deprecated_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (DeprecatedEnum) Type() protoreflect.EnumType {
- return file_comments_deprecated_proto_enumTypes[0]
-}
-
func (x DeprecatedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
index d25a814..3d2627f 100644
--- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
@@ -50,11 +50,6 @@
return file_extensions_ext_ext_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum) Type() protoreflect.EnumType {
- return file_extensions_ext_ext_proto_enumTypes[0]
-}
-
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
index 14bb7c9..f98c06b 100644
--- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
@@ -49,11 +49,6 @@
return file_extensions_proto3_ext3_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum) Type() protoreflect.EnumType {
- return file_extensions_proto3_ext3_proto_enumTypes[0]
-}
-
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
index a02d00a..68f0084 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
@@ -54,11 +54,6 @@
return file_import_public_sub_a_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (E) Type() protoreflect.EnumType {
- return file_import_public_sub_a_proto_enumTypes[0]
-}
-
func (x E) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -108,11 +103,6 @@
return file_import_public_sub_a_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (M_Subenum) Type() protoreflect.EnumType {
- return file_import_public_sub_a_proto_enumTypes[1]
-}
-
func (x M_Subenum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -162,11 +152,6 @@
return file_import_public_sub_a_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (M_Submessage_Submessage_Subenum) Type() protoreflect.EnumType {
- return file_import_public_sub_a_proto_enumTypes[2]
-}
-
func (x M_Submessage_Submessage_Subenum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
index 551577f..8530e07 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
@@ -48,11 +48,6 @@
return file_imports_test_a_1_m1_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (E1) Type() protoreflect.EnumType {
- return file_imports_test_a_1_m1_proto_enumTypes[0]
-}
-
func (x E1) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
index 529effc..a9e3cf5 100644
--- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
+++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
@@ -48,11 +48,6 @@
return file_nopackage_nopackage_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum) Type() protoreflect.EnumType {
- return file_nopackage_nopackage_proto_enumTypes[0]
-}
-
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
index 7fcd160..8f9c18b 100644
--- a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
@@ -54,11 +54,6 @@
return file_proto2_enum_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (EnumType1) Type() protoreflect.EnumType {
- return file_proto2_enum_proto_enumTypes[0]
-}
-
func (x EnumType1) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -111,11 +106,6 @@
return file_proto2_enum_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (EnumType2) Type() protoreflect.EnumType {
- return file_proto2_enum_proto_enumTypes[1]
-}
-
func (x EnumType2) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -167,11 +157,6 @@
return file_proto2_enum_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (EnumContainerMessage1_NestedEnumType1A) Type() protoreflect.EnumType {
- return file_proto2_enum_proto_enumTypes[2]
-}
-
func (x EnumContainerMessage1_NestedEnumType1A) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -221,11 +206,6 @@
return file_proto2_enum_proto_enumTypes[3].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (EnumContainerMessage1_NestedEnumType1B) Type() protoreflect.EnumType {
- return file_proto2_enum_proto_enumTypes[3]
-}
-
func (x EnumContainerMessage1_NestedEnumType1B) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -277,11 +257,6 @@
return file_proto2_enum_proto_enumTypes[4].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Type() protoreflect.EnumType {
- return file_proto2_enum_proto_enumTypes[4]
-}
-
func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -331,11 +306,6 @@
return file_proto2_enum_proto_enumTypes[5].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Type() protoreflect.EnumType {
- return file_proto2_enum_proto_enumTypes[5]
-}
-
func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
index 110d009..afc649d 100644
--- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
@@ -52,11 +52,6 @@
return file_proto2_fields_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FieldTestMessage_Enum) Type() protoreflect.EnumType {
- return file_proto2_fields_proto_enumTypes[0]
-}
-
func (x FieldTestMessage_Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
index 92e4569..7515d4a 100644
--- a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
@@ -53,11 +53,6 @@
return file_proto3_enum_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum) Type() protoreflect.EnumType {
- return file_proto3_enum_proto_enumTypes[0]
-}
-
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
index ceb0276..81906e9 100644
--- a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
@@ -48,11 +48,6 @@
return file_proto3_fields_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FieldTestMessage_Enum) Type() protoreflect.EnumType {
- return file_proto3_fields_proto_enumTypes[0]
-}
-
func (x FieldTestMessage_Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/encoding/testprotos/pb2/test.pb.go b/encoding/testprotos/pb2/test.pb.go
index 2d696e2..63b9cf0 100644
--- a/encoding/testprotos/pb2/test.pb.go
+++ b/encoding/testprotos/pb2/test.pb.go
@@ -61,11 +61,6 @@
return file_pb2_test_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum) Type() protoreflect.EnumType {
- return file_pb2_test_proto_enumTypes[0]
-}
-
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -121,11 +116,6 @@
return file_pb2_test_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enums_NestedEnum) Type() protoreflect.EnumType {
- return file_pb2_test_proto_enumTypes[1]
-}
-
func (x Enums_NestedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/encoding/testprotos/pb3/test.pb.go b/encoding/testprotos/pb3/test.pb.go
index c919a67..0ec0eaf 100644
--- a/encoding/testprotos/pb3/test.pb.go
+++ b/encoding/testprotos/pb3/test.pb.go
@@ -57,11 +57,6 @@
return file_pb3_test_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum) Type() protoreflect.EnumType {
- return file_pb3_test_proto_enumTypes[0]
-}
-
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -110,11 +105,6 @@
return file_pb3_test_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enums_NestedEnum) Type() protoreflect.EnumType {
- return file_pb3_test_proto_enumTypes[1]
-}
-
func (x Enums_NestedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/impl/legacy_enum.go b/internal/impl/legacy_enum.go
index 7aa8b84..6758e74 100644
--- a/internal/impl/legacy_enum.go
+++ b/internal/impl/legacy_enum.go
@@ -60,10 +60,6 @@
goTyp reflect.Type
}
-// TODO: Remove this.
-func (e *legacyEnumWrapper) Type() pref.EnumType {
- return e.pbTyp
-}
func (e *legacyEnumWrapper) Descriptor() pref.EnumDescriptor {
return e.pbTyp.Descriptor()
}
diff --git a/internal/impl/message_deprecated.go b/internal/impl/message_deprecated.go
index 7391c1b..ef98f3f 100644
--- a/internal/impl/message_deprecated.go
+++ b/internal/impl/message_deprecated.go
@@ -13,11 +13,6 @@
// TODO: Remove this file.
// TODO: Remove this.
-func (m *messageReflectWrapper) Type() pref.MessageType {
- return m.mi.PBType
-}
-
-// TODO: Remove this.
func (m *messageReflectWrapper) KnownFields() pref.KnownFields {
m.mi.init()
return (*knownFields)(m)
diff --git a/internal/impl/message_test.go b/internal/impl/message_test.go
index bb10ead..722d1c0 100644
--- a/internal/impl/message_test.go
+++ b/internal/impl/message_test.go
@@ -933,8 +933,6 @@
},
}
-// TODO: Remove this.
-func (e EnumProto2) Type() pref.EnumType { return enumProto2Type }
func (e EnumProto2) Descriptor() pref.EnumDescriptor { return enumProto2Type.Descriptor() }
func (e EnumProto2) Enum() *EnumProto2 { return &e }
func (e EnumProto2) Number() pref.EnumNumber { return pref.EnumNumber(e) }
@@ -952,8 +950,6 @@
},
}
-// TODO: Remove this.
-func (e EnumProto3) Type() pref.EnumType { return enumProto3Type }
func (e EnumProto3) Descriptor() pref.EnumDescriptor { return enumProto3Type.Descriptor() }
func (e EnumProto3) Enum() *EnumProto3 { return &e }
func (e EnumProto3) Number() pref.EnumNumber { return pref.EnumNumber(e) }
diff --git a/internal/testprotos/conformance/conformance.pb.go b/internal/testprotos/conformance/conformance.pb.go
index a1ae3bf..b2e21e2 100644
--- a/internal/testprotos/conformance/conformance.pb.go
+++ b/internal/testprotos/conformance/conformance.pb.go
@@ -60,11 +60,6 @@
return file_conformance_conformance_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (WireFormat) Type() protoreflect.EnumType {
- return file_conformance_conformance_proto_enumTypes[0]
-}
-
func (x WireFormat) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -127,11 +122,6 @@
return file_conformance_conformance_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestCategory) Type() protoreflect.EnumType {
- return file_conformance_conformance_proto_enumTypes[1]
-}
-
func (x TestCategory) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/testprotos/conformance/test_messages_proto2.pb.go b/internal/testprotos/conformance/test_messages_proto2.pb.go
index 661b0dc..50f5d17 100644
--- a/internal/testprotos/conformance/test_messages_proto2.pb.go
+++ b/internal/testprotos/conformance/test_messages_proto2.pb.go
@@ -54,11 +54,6 @@
return file_google_protobuf_test_messages_proto2_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (ForeignEnumProto2) Type() protoreflect.EnumType {
- return file_google_protobuf_test_messages_proto2_proto_enumTypes[0]
-}
-
func (x ForeignEnumProto2) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -117,11 +112,6 @@
return file_google_protobuf_test_messages_proto2_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestAllTypesProto2_NestedEnum) Type() protoreflect.EnumType {
- return file_google_protobuf_test_messages_proto2_proto_enumTypes[1]
-}
-
func (x TestAllTypesProto2_NestedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/testprotos/conformance/test_messages_proto3.pb.go b/internal/testprotos/conformance/test_messages_proto3.pb.go
index 52ae7d3..75ffa5b 100644
--- a/internal/testprotos/conformance/test_messages_proto3.pb.go
+++ b/internal/testprotos/conformance/test_messages_proto3.pb.go
@@ -60,11 +60,6 @@
return file_google_protobuf_test_messages_proto3_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (ForeignEnum) Type() protoreflect.EnumType {
- return file_google_protobuf_test_messages_proto3_proto_enumTypes[0]
-}
-
func (x ForeignEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -113,11 +108,6 @@
return file_google_protobuf_test_messages_proto3_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestAllTypesProto3_NestedEnum) Type() protoreflect.EnumType {
- return file_google_protobuf_test_messages_proto3_proto_enumTypes[1]
-}
-
func (x TestAllTypesProto3_NestedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -172,11 +162,6 @@
return file_google_protobuf_test_messages_proto3_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestAllTypesProto3_AliasedEnum) Type() protoreflect.EnumType {
- return file_google_protobuf_test_messages_proto3_proto_enumTypes[2]
-}
-
func (x TestAllTypesProto3_AliasedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/testprotos/irregular/irregular_deprecated.go b/internal/testprotos/irregular/irregular_deprecated.go
index d49855a..f229128 100644
--- a/internal/testprotos/irregular/irregular_deprecated.go
+++ b/internal/testprotos/irregular/irregular_deprecated.go
@@ -8,8 +8,6 @@
pref "google.golang.org/protobuf/reflect/protoreflect"
)
-// TODO: Remove this.
-func (m *message) Type() pref.MessageType { return nil }
func (m *message) KnownFields() pref.KnownFields { return (*known)(m) }
func (m *message) UnknownFields() pref.UnknownFields { return (*unknown)(m) }
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index 86c69ed..225870f 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -55,11 +55,6 @@
return file_test_test_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (ForeignEnum) Type() protoreflect.EnumType {
- return file_test_test_proto_enumTypes[0]
-}
-
func (x ForeignEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -109,11 +104,6 @@
return file_test_test_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestReservedEnumFields) Type() protoreflect.EnumType {
- return file_test_test_proto_enumTypes[1]
-}
-
func (x TestReservedEnumFields) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -172,11 +162,6 @@
return file_test_test_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestAllTypes_NestedEnum) Type() protoreflect.EnumType {
- return file_test_test_proto_enumTypes[2]
-}
-
func (x TestAllTypes_NestedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -225,11 +210,6 @@
return file_test_test_proto_enumTypes[3].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestDeprecatedMessage_DeprecatedEnum) Type() protoreflect.EnumType {
- return file_test_test_proto_enumTypes[3]
-}
-
func (x TestDeprecatedMessage_DeprecatedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go
index 2288939..6ec7c37 100644
--- a/internal/testprotos/test/test_import.pb.go
+++ b/internal/testprotos/test/test_import.pb.go
@@ -48,11 +48,6 @@
return file_test_test_import_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (ImportEnum) Type() protoreflect.EnumType {
- return file_test_test_import_proto_enumTypes[0]
-}
-
func (x ImportEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/testprotos/test3/test.pb.go b/internal/testprotos/test3/test.pb.go
index fc3df02..129d836 100644
--- a/internal/testprotos/test3/test.pb.go
+++ b/internal/testprotos/test3/test.pb.go
@@ -57,11 +57,6 @@
return file_test3_test_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (ForeignEnum) Type() protoreflect.EnumType {
- return file_test3_test_proto_enumTypes[0]
-}
-
func (x ForeignEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -110,11 +105,6 @@
return file_test3_test_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (TestAllTypes_NestedEnum) Type() protoreflect.EnumType {
- return file_test3_test_proto_enumTypes[1]
-}
-
func (x TestAllTypes_NestedEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/internal/testprotos/test3/test_import.pb.go b/internal/testprotos/test3/test_import.pb.go
index 558b8b6..e5ad6b9 100644
--- a/internal/testprotos/test3/test_import.pb.go
+++ b/internal/testprotos/test3/test_import.pb.go
@@ -48,11 +48,6 @@
return file_test3_test_import_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (ImportEnum) Type() protoreflect.EnumType {
- return file_test3_test_import_proto_enumTypes[0]
-}
-
func (x ImportEnum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/reflect/protoreflect/deprecated.go b/reflect/protoreflect/deprecated.go
index ff7fa21..87d17cf 100644
--- a/reflect/protoreflect/deprecated.go
+++ b/reflect/protoreflect/deprecated.go
@@ -7,14 +7,7 @@
// TODO: Remove this file.
type (
- deprecatedEnum interface {
- // Deprecated: Use Descriptor instead.
- Type() EnumType
- }
-
deprecatedMessage interface {
- // Deprecated: Use Descriptor instead.
- Type() MessageType
// Deprecated: Use methods on Message directly.
KnownFields() KnownFields
// Deprecated: Use methods on Message directly.
diff --git a/reflect/protoreflect/value.go b/reflect/protoreflect/value.go
index 44ec46c..cf4a011 100644
--- a/reflect/protoreflect/value.go
+++ b/reflect/protoreflect/value.go
@@ -15,8 +15,6 @@
// Number returns the enum value as an integer.
Number() EnumNumber
-
- deprecatedEnum
}
// Message is a reflective interface for a concrete message value,
diff --git a/reflect/protoregistry/testprotos/test.pb.go b/reflect/protoregistry/testprotos/test.pb.go
index 5cce802..b6d70e4 100644
--- a/reflect/protoregistry/testprotos/test.pb.go
+++ b/reflect/protoregistry/testprotos/test.pb.go
@@ -48,11 +48,6 @@
return file_test_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum1) Type() protoreflect.EnumType {
- return file_test_proto_enumTypes[0]
-}
-
func (x Enum1) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -102,11 +97,6 @@
return file_test_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum2) Type() protoreflect.EnumType {
- return file_test_proto_enumTypes[1]
-}
-
func (x Enum2) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -156,11 +146,6 @@
return file_test_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Enum3) Type() protoreflect.EnumType {
- return file_test_proto_enumTypes[2]
-}
-
func (x Enum3) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/types/descriptorpb/descriptor.pb.go b/types/descriptorpb/descriptor.pb.go
index aa1c561..0dd8234 100644
--- a/types/descriptorpb/descriptor.pb.go
+++ b/types/descriptorpb/descriptor.pb.go
@@ -110,11 +110,6 @@
return file_google_protobuf_descriptor_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FieldDescriptorProto_Type) Type() protoreflect.EnumType {
- return file_google_protobuf_descriptor_proto_enumTypes[0]
-}
-
func (x FieldDescriptorProto_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -171,11 +166,6 @@
return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FieldDescriptorProto_Label) Type() protoreflect.EnumType {
- return file_google_protobuf_descriptor_proto_enumTypes[1]
-}
-
func (x FieldDescriptorProto_Label) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -233,11 +223,6 @@
return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FileOptions_OptimizeMode) Type() protoreflect.EnumType {
- return file_google_protobuf_descriptor_proto_enumTypes[2]
-}
-
func (x FileOptions_OptimizeMode) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -294,11 +279,6 @@
return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FieldOptions_CType) Type() protoreflect.EnumType {
- return file_google_protobuf_descriptor_proto_enumTypes[3]
-}
-
func (x FieldOptions_CType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -357,11 +337,6 @@
return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (FieldOptions_JSType) Type() protoreflect.EnumType {
- return file_google_protobuf_descriptor_proto_enumTypes[4]
-}
-
func (x FieldOptions_JSType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -420,11 +395,6 @@
return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (MethodOptions_IdempotencyLevel) Type() protoreflect.EnumType {
- return file_google_protobuf_descriptor_proto_enumTypes[5]
-}
-
func (x MethodOptions_IdempotencyLevel) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/types/known/structpb/struct.pb.go b/types/known/structpb/struct.pb.go
index 006d03e..47c693f 100644
--- a/types/known/structpb/struct.pb.go
+++ b/types/known/structpb/struct.pb.go
@@ -53,11 +53,6 @@
return file_google_protobuf_struct_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (NullValue) Type() protoreflect.EnumType {
- return file_google_protobuf_struct_proto_enumTypes[0]
-}
-
func (x NullValue) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
diff --git a/types/known/typepb/type.pb.go b/types/known/typepb/type.pb.go
index cdab12a..aae8ab5 100644
--- a/types/known/typepb/type.pb.go
+++ b/types/known/typepb/type.pb.go
@@ -56,11 +56,6 @@
return file_google_protobuf_type_proto_enumTypes[0].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Syntax) Type() protoreflect.EnumType {
- return file_google_protobuf_type_proto_enumTypes[0]
-}
-
func (x Syntax) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -174,11 +169,6 @@
return file_google_protobuf_type_proto_enumTypes[1].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Field_Kind) Type() protoreflect.EnumType {
- return file_google_protobuf_type_proto_enumTypes[1]
-}
-
func (x Field_Kind) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
@@ -232,11 +222,6 @@
return file_google_protobuf_type_proto_enumTypes[2].Descriptor()
}
-// Deprecated: Use Descriptor instead.
-func (Field_Cardinality) Type() protoreflect.EnumType {
- return file_google_protobuf_type_proto_enumTypes[2]
-}
-
func (x Field_Cardinality) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}