internal/impl: unexport ExtensionField.Desc

CL/180577 removes direct access to the Desc field in v1.

Since the only way to access the type is through {Has,Get,Set}Type,
we can now unexport the field and change the underlying type.

Change-Id: I6cc7018d4326c17228ba579d6161c5fb3f6d4127
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/180578
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/cmd/protoc-gen-go-grpc/testdata/go.mod b/cmd/protoc-gen-go-grpc/testdata/go.mod
index fb87f76..5e8ee64 100644
--- a/cmd/protoc-gen-go-grpc/testdata/go.mod
+++ b/cmd/protoc-gen-go-grpc/testdata/go.mod
@@ -1,7 +1,7 @@
 module google.golang.org/protobuf/cmd/protoc-gen-go-grpc/testdata
 
 require (
-	github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4
+	github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba
 	google.golang.org/grpc v1.19.0
 	google.golang.org/protobuf v1.0.0
 )
diff --git a/cmd/protoc-gen-go/testdata/go.mod b/cmd/protoc-gen-go/testdata/go.mod
index c945b8a..a766e71 100644
--- a/cmd/protoc-gen-go/testdata/go.mod
+++ b/cmd/protoc-gen-go/testdata/go.mod
@@ -1,7 +1,7 @@
 module google.golang.org/protobuf/cmd/protoc-gen-go/testdata
 
 require (
-	github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4
+	github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba
 	google.golang.org/protobuf v1.0.0
 )
 
diff --git a/go.mod b/go.mod
index f458e00..5b9ac2e 100644
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,6 @@
 go 1.9
 
 require (
-	github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4
+	github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba
 	github.com/google/go-cmp v0.3.0
 )
diff --git a/go.sum b/go.sum
index 0603b6f..b955349 100644
--- a/go.sum
+++ b/go.sum
@@ -2,8 +2,9 @@
 github.com/golang/protobuf v1.2.1-0.20190515194842-7574ba03306e/go.mod h1:GjgUz9uwrRQmdPBBrFqiVbojAmlpy6ryM6DCzC+20rE=
 github.com/golang/protobuf v1.2.1-0.20190516201927-a2cd3ac1b343/go.mod h1:PScGDF2x230A126tLt9Ol9RjhXzbiPJrt/CogooD2mE=
 github.com/golang/protobuf v1.2.1-0.20190516215712-ae2eaafab405/go.mod h1:UmP8hhPKR5WWIjbT9v0JEVT+U0DBSjbW8KaZVeyFfRE=
-github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4 h1:266Mauktp82G9qvMyYdGtx+yv9kmSkBSVw2BOgK8578=
 github.com/golang/protobuf v1.2.1-0.20190523175523-a1331f0b4ab4/go.mod h1:G+fNMoyvKWZDB7PCDHF+dXbH9OeE3+JoozCd9V7i66U=
+github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba h1:P0A9EXL00gtVRHb/i9BrNgjZw4jpo4lhQh2PyziSET4=
+github.com/golang/protobuf v1.2.1-0.20190605195750-76c9e09470ba/go.mod h1:S1YIJXvYHGRCG2UmZsOcElkAYfvZLg2sDRr9+Xu8JXU=
 github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
 github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 google.golang.org/protobuf v0.0.0-20190514172829-e89e6244e0e8/go.mod h1:791zQGC15vDqjpmPRn1uGPu5oHy/Jzw/Q1n5JsgIIcY=
@@ -11,3 +12,4 @@
 google.golang.org/protobuf v0.0.0-20190516201745-40b83d67fc75/go.mod h1:jf+u8AHuKtkib+0J4/bQXPNzCmT3V9a02hVzYKtatuw=
 google.golang.org/protobuf v0.0.0-20190516215540-a95b29fbf623/go.mod h1:cWWmz5lsCWIcqGLROrKq5Lu231IJw2PzqOZ8cgspbfY=
 google.golang.org/protobuf v0.0.0-20190522194032-21ade498bd69/go.mod h1:cJytyYi/6qdwy/+gD49hmgHcwD7zhWxE/1KPEslaZ3M=
+google.golang.org/protobuf v0.0.0-20190605195314-89d49632e5cf/go.mod h1:Btug4TBaP5wNYcb2zGKDTS7WMcaPPLuqEAKfEAZWYbo=
diff --git a/internal/impl/codec_extension.go b/internal/impl/codec_extension.go
index 69d5a96..577f1df 100644
--- a/internal/impl/codec_extension.go
+++ b/internal/impl/codec_extension.go
@@ -10,7 +10,6 @@
 
 	"google.golang.org/protobuf/internal/encoding/wire"
 	pref "google.golang.org/protobuf/reflect/protoreflect"
-	piface "google.golang.org/protobuf/runtime/protoiface"
 )
 
 type extensionFieldInfo struct {
@@ -46,9 +45,7 @@
 }
 
 type ExtensionField struct {
-	// Desc is the descriptor information for the extension field.
-	// It must be populated if value is populated.
-	Desc *piface.ExtensionDescV1 // TODO: unexport and switch to protoreflect.ExtensionType
+	typ pref.ExtensionType
 
 	// value is either the value of GetValue,
 	// or a *lazyExtensionValue that then returns the value of GetValue.
@@ -56,13 +53,13 @@
 }
 
 func (f ExtensionField) HasType() bool {
-	return f.Desc != nil
+	return f.typ != nil
 }
 func (f ExtensionField) GetType() pref.ExtensionType {
-	return legacyExtensionTypeFromDesc(f.Desc)
+	return f.typ
 }
 func (f *ExtensionField) SetType(t pref.ExtensionType) {
-	f.Desc = legacyExtensionDescFromType(t)
+	f.typ = t
 }
 
 // HasValue reports whether a value is set for the extension field.