cmd/doc: does not generate docs for generic functions that return []T #48485
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?linux amd64
What did you do?
I wrote a generic function(inside package), run
gotip doc -all -c -u [package-name]
What did you expect to see?
expect to see the function signature in output, like
func Intersection[T comparable](slices... []T) []T
What did you see instead?
functions that return
[]T
are not printed, others likefunc Some[T any](slice []T, pred func(T) bool) bool
are printedI tried dig into the doc generator, found that
factory functions of T
, their associations gotyp.funcs.set
branch instead ofr.funcs.set
cleanupTypes()
deleted T from r.types because it has no definitiondocPkg.Types
, thus no results are printedwith following
immature hackdiff those functions will be printed:The text was updated successfully, but these errors were encountered: