Skip to content

x/tools/gopls: "expected exported symbol" assert in getOneTransitiveRefLocked #71356

@adonovan

Description

@adonovan
#!stacks
"cache.assert" && "evaluatePackageHandle.func1:+2"

Issue created by stacks.

// getOneTransitiveRefLocked computes the full set packages transitively
// reachable through the given sym reference.
//
// It may return nil if the reference is invalid (i.e. the referenced name does
// not exist).
func (b *packageHandleBuilder) getOneTransitiveRefLocked(sym typerefs.Symbol) *typerefs.PackageSet {
	assert(token.IsExported(sym.Name), "expected exported symbol")  <--- here

	trefs := b.transitiveRefs[sym.Package]
	if trefs == nil {
		trefs = &partialRefs{
			refs:     make(map[string]*typerefs.PackageSet),
			complete: false,
		}
		b.transitiveRefs[sym.Package] = trefs
	}

This stack N2fS6w was reported by telemetry:

golang.org/x/tools/gopls@v0.17.0 go1.23.4 linux/amd64 vscode (1)

Metadata

Metadata

Assignees

Labels

NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)gopls/telemetry-wins

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions