diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index 07ead61b..ce1abef7 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -8021,6 +8021,8 @@ func TestIssue50208(t *testing.T) { } } +*/ + func TestNegativeKindString(t *testing.T) { x := -1 s := Kind(x).String() @@ -8030,8 +8032,6 @@ func TestNegativeKindString(t *testing.T) { } } -*/ - type ( namedBool bool namedBytes []byte diff --git a/src/reflect/type.go b/src/reflect/type.go index 76fe3aa4..1c1a17bb 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -116,6 +116,8 @@ const Ptr = Pointer func (k Kind) String() string { switch k { + case Invalid: + return "invalid" case Bool: return "bool" case Int: @@ -169,7 +171,7 @@ func (k Kind) String() string { case Struct: return "struct" default: - return "invalid" + return "kind" + itoa.Itoa(int(int8(k))) } }