internal/impl: implement Vector fields

Generate functions for wrapping []T to implement protoreflect.Vector.
This implementation uses Go reflection instead to provide a single implementation
that can handle all Go slice types.

The test harness was greatly expanded to be able to test vectors (in addition
to messages and maps in the near future).

Change-Id: I0106c175f84a1e7e0a0a5b0e02e2489b70b0d177
Reviewed-on: https://go-review.googlesource.com/c/135339
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/impl/message.go b/internal/impl/message.go
index f51526b..2a908c2 100644
--- a/internal/impl/message.go
+++ b/internal/impl/message.go
@@ -215,7 +215,7 @@
 func (m *message) UnknownFields() pref.UnknownFields {
 	return (*unknownFields)(m)
 }
-func (m *message) Unwrap() interface{} {
+func (m *message) Unwrap() interface{} { // TODO: unexport?
 	return m.p.asType(m.mi.goType.Elem()).Interface()
 }
 func (m *message) Interface() pref.ProtoMessage {
@@ -266,7 +266,7 @@
 		return
 	}
 	// TODO: Handle extension fields.
-	panic("invalid field")
+	panic(fmt.Sprintf("invalid field: %d", n))
 }
 func (fs *knownFields) Clear(n pref.FieldNumber) {
 	if fi := fs.mi.fields[n]; fi != nil {
@@ -274,14 +274,14 @@
 		return
 	}
 	// TODO: Handle extension fields.
-	panic("invalid field")
+	panic(fmt.Sprintf("invalid field: %d", n))
 }
 func (fs *knownFields) Mutable(n pref.FieldNumber) pref.Mutable {
 	if fi := fs.mi.fields[n]; fi != nil {
 		return fi.mutable(fs.p)
 	}
 	// TODO: Handle extension fields.
-	panic("invalid field")
+	panic(fmt.Sprintf("invalid field: %d", n))
 }
 func (fs *knownFields) Range(f func(pref.FieldNumber, pref.Value) bool) {
 	for n, fi := range fs.mi.fields {