Skip to content

x/tools/gopls: interface conversion: types.Object is *types.Var, not *types.Func #67975

Closed as not planned
@yeaha

Description

@yeaha

gopls version: v0.15.3/go1.22.1
gopls flags:
update flags: proxy
extension version: 0.41.4
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Thu, 13 Jun 2024 09:17:59 GMT
restart history:
Wed, 12 Jun 2024 03:35:37 GMT: activation (enabled: true)
Wed, 12 Jun 2024 05:06:05 GMT: manual (enabled: true)
Wed, 12 Jun 2024 05:07:03 GMT: manual (enabled: true)
Thu, 13 Jun 2024 09:17:52 GMT: manual (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: interface conversion: types.Object is *types.Var, not *types.Func

goroutine 4625 [running]:
golang.org/x/tools/internal/typeparams.OriginMethod(0xc001cf8ae0)
	  common.go:134  0x248
golang.org/x/tools/gopls/internal/cache/methodsets.(*indexBuilder).build.func2(0xc002575340, 0xc001cf8ae0)
	  methodsets.go:232  0x1c5
golang.org/x/tools/gopls/internal/cache/methodsets.methodSetInfo({0x128f310, 0xc000188e70}, 0xc00225baf8)
	  methodsets.go:293  0x238
golang.org/x/tools/gopls/internal/cache/methodsets.(*indexBuilder).build(0xc00225bb78, 0xc001864b80, 0xc001bf5140)
	  methodsets.go:245  0x49d
golang.org/x/tools/gopls/internal/cache/methodsets.NewIndex(...)
	  methodsets.go:82
golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).methodsets.func1()
	  pkg.go:79  0x45
sync.(*Once).doSlow(0xc0000ec808%3F, 0xc0000ece10%3F)
	  once.go:74  0xc2
sync.(*Once).Do(...)
	  once.go:65
golang.org/x/tools/gopls/internal/cache.(*syntaxPackage).methodsets(0xc002802780)
	  pkg.go:78  0x4a
golang.org/x/tools/gopls/internal/cache.storePackageResults({0x1293c28, 0xc001bb7c80}, 0xc0020bcb40, 0xc002d35200)
	  check.go:583  0x137
created by golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage in goroutine 4606
	  check.go:570  0x69b
gopls stats -anon { "DirStats": { "Files": 55, "TestdataFiles": 0, "GoFiles": 11, "ModFiles": 1, "Dirs": 27 }, "GOARCH": "amd64", "GOOS": "linux", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.1", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "795.365217ms", "MemStats": { "HeapAlloc": 19938456, "HeapInUse": 32956416, "TotalAlloc": 309115200 }, "WorkspaceStats": { "Files": { "Total": 1090, "Largest": 395026, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "AllPackages": { "Packages": 177, "LargestPackage": 161, "CompiledGoFiles": 1090, "Modules": 11 }, "WorkspacePackages": { "Packages": 4, "LargestPackage": 8, "CompiledGoFiles": 15, "Modules": 1 }, "Diagnostics": 0 } ] } }

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions