runtime/internal/lib/reflect: fix Field closure kind to func

This commit is contained in:
visualfc
2025-09-26 10:18:23 +08:00
parent 8959c83397
commit ccaf59ec62
2 changed files with 14 additions and 1 deletions

View File

@@ -39,4 +39,12 @@ func main() {
panic(fmt.Sprintf("not func: %T", fn))
}
}
v := reflect.ValueOf(T{})
if v.Field(0).Kind() != reflect.Func {
panic("must func")
}
}
type T struct {
fn func(int)
}