diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index c257bec1e5..31f6416ed9 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -3281,14 +3281,16 @@ type unexpI interface { f() (int32, int8) } -var unexpi unexpI = new(unexp) - func TestUnexportedMethods(t *testing.T) { - typ := TypeOf(unexpi) - + typ := TypeOf(new(unexp)) if got := typ.NumMethod(); got != 0 { t.Errorf("NumMethod=%d, want 0 satisfied methods", got) } + + typ = TypeOf((*unexpI)(nil)) + if got := typ.Elem().NumMethod(); got != 1 { + t.Errorf("NumMethod=%d, want 1 satisfied methods", got) + } } type InnerInt struct {