Skip to content

go/types, types2: gopls crash in recordTypeAndValue #51658

Closed
@sxwebdev

Description

gopls version: v0.8.0 (devel go1.19-c9b60632eb Fri Mar 4 14:10:38 2022 0000)
gopls flags:
update flags: proxy
extension version: 0.32.0
go version: devel 1.19-c9b60632eb
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Sat, 12 Mar 2022 09:33:04 GMT
restart history:
Sat, 12 Mar 2022 09:24:24 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: assertion failed

goroutine 1358 [running]:
go/types.(*Checker).handleBailout(0xc0022c28c0, 0xc002aed650)
	  check.go:303  0x8b
panic({0x1873ce0, 0x1bf6cf0})
	  panic.go:838  0x207
go/types.assert(...)
	  errors.go:21
go/types.(*Checker).recordTypeAndValue(0xc0022c28c0%3F, {0x1bfe410%3F, 0xc00102af60%3F}, 0x4%3F, {0x1bfc4f0%3F, 0xc002ab6fc0%3F}, {0x1c001e0%3F, 0x209df00%3F})
	  check.go:454  0x1f6
go/types.(*Checker).updateExprType0(0xc0022c28c0, {0xc002af0940%3F, 0x1bfc4f0%3F}, {0x1bfe410%3F, 0xc00102af60}, {0x1bfc4f0%3F, 0xc002ab6fc0%3F}, 0x0)
	  expr.go:593  0x831
go/types.(*Checker).updateExprType(...)
	  expr.go:476
go/types.(*Checker).convertUntyped(0xc0022c28c0, 0xc002af0940, {0x1bfc4f0, 0xc002ab6fc0})
	  expr.go:622  0x2b3
go/types.(*Checker).binary(0xa%3F, 0xc002af0900, {0x1bfe440%3F, 0xc0012868a0}, {0x1bfe7d0%3F, 0xc00102af00}, {0x1bfe410%3F, 0xc00102af60}, 0x27, 0xfd)
	  expr.go:1106  0x1f9
go/types.(*Checker).exprInternal(0xc0022c28c0, 0xc002af0900, {0x1bfe440%3F, 0xc0012868a0}, {0x0%3F, 0x0%3F})
	  expr.go:1624  0xa3f
go/types.(*Checker).rawExpr(0xc000600000%3F, 0xc002af0900%3F, {0x1bfe440%3F, 0xc0012868a0%3F}, {0x0%3F, 0x0%3F}, 0x0)
	  expr.go:1208  0x45
go/types.(*Checker).expr(0xc0022c28c0%3F, 0x0%3F, {0x1bfe440%3F, 0xc0012868a0%3F})
	  expr.go:1704  0x35
go/types.(*Checker).stmt(0xc0022c28c0, 0x0, {0x1bfe800%3F, 0xc0009c7600%3F})
	  stmt.go:567  0x2630
go/types.(*Checker).stmtList(0xc0022c28c0%3F, 0x0, {0xc00102b040%3F, 0x0%3F, 0xc002ab04c8%3F})
	  stmt.go:125  0xc9
go/types.(*Checker).funcBody(0xc0022c28c0, 0xc001ea52c0, {0x0%3F, 0xc002aed5f0%3F}, 0xc002af0480, 0xc001286900, {0x0, 0x0})
	  stmt.go:46  0x285
go/types.(*Checker).funcDecl.func1()
	  decl.go:788  0x45
go/types.(*Checker).processDelayed(0xc0022c28c0, 0x0)
	  check.go:388  0x39
go/types.(*Checker).checkFiles(0xc0022c28c0, {0xc002aa65c0%3F, 0xc002a93d60%3F, 0x0%3F})
	  check.go:336  0xcb
go/types.(*Checker).Files(...)
	  check.go:308
golang.org/x/tools/internal/lsp/cache.doTypeCheck({0x1bffbf8, 0xc002a89f40}, 0xc002478000, 0xc000a46f00, 0x2, 0xc002ab69f0, 0x1bfef80%3F)
	  check.go:551  0x97b
golang.org/x/tools/internal/lsp/cache.typeCheck({0x1bffbf8, 0xc002a89f40}, 0xc002478000, 0xc000a46f00, 0x2, 0xc002ab69f0%3F)
	  check.go:317  0xe5
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildPackageHandle.func1({0x1bffbf8%3F, 0xc002a89f40}, {0x1bf9340%3F, 0xc002478000})
	  check.go:125  0x233
golang.org/x/tools/internal/memoize.(*Handle).run.func1()
	  memoize.go:327  0xa9
created by golang.org/x/tools/internal/memoize.(*Handle).run
	  memoize.go:320  0x1b8
[Error - 12:32:54] 

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

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions