Skip to content

go/doc: NewFromFiles panics on ast.Files that lack ast.Objects due to parser.SkipObjectResolution #66290

Closed
@adonovan

Description

@adonovan

doc.NewFromFiles calls ast.NewPackage on the specified files. NewPackage uses the Scope field of ast.File. However this field is unset if the syntactic identifier resolution (which was deprecated in #52463) is disabled, causing it to panic.

It should either not panic (e.g. by skipping the logic if Scope is nil, which I think causes it to work fine for NewFromFiles), or the precondition should be documented.

Metadata

Metadata

Assignees

Labels

FixPendingIssues that have a fix which has not yet been reviewed or submitted.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions