go/ast: TypeSpec.Doc is nil? Have to grab documentation at GenDecl #27477
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?darwin
Question
Noticed in the AST for type instantiated structures, that if I go to the
Doc
field inast.TypeSpec
the value isnil
. I have to visit theast.GenDecl
node instead to grab doc fields.Is this intended?
If so, why does
ast.TypeSpec
have aDoc
field? ShouldDoc
along withComment
be deprecated, as in mentioned in the docs, since comments/documentation really do not have anything to do with the type specification?This can reproduce by parsing the code sample below
expectation
ast.TypeSpec
contain non-nil
value forDoc
when documentation is provided.The text was updated successfully, but these errors were encountered: