dominikh / go-tools

Staticcheck - The advanced Go linter
https://staticcheck.dev
MIT License
6.16k stars 375 forks source link

panic: Named.check == nil but type is incomplete #1593

Open IluckySi opened 2 months ago

IluckySi commented 2 months ago

When I execute /data/xxx/staticcheck/staticcheck ./... in my project,,occur the following exception:

`panic: Named.check == nil but type is incomplete

goroutine 375 [running]: go/types.(Named).under(0xc001d34ee0) go/types/named.go:548 +0x406 go/types.under({0xa5adb0, 0xc001d34ee0}) go/types/under.go:16 +0x2a go/types.isPointer(...) go/types/conversions.go:308 go/types.NewMethodSet({0xa5adb0, 0xc001d34ee0}) go/types/methodset.go:83 +0x46 golang.org/x/tools/go/types/typeutil.(MethodSetCache).lookupNamed(0xc001963890, 0xc001d34ee0) golang.org/x/tools@v0.21.1-0.20240531212143-b6235391adb3/go/types/typeutil/methodsetcache.go:68 +0x8f golang.org/x/tools/go/types/typeutil.(MethodSetCache).MethodSet(0xc001963890, {0xa5adb0, 0xc001d34ee0}) golang.org/x/tools@v0.21.1-0.20240531212143-b6235391adb3/go/types/typeutil/methodsetcache.go:39 +0xc5 honnef.co/go/tools/go/ir.(Program).needMethods(0xc001963860, {0xa5adb0, 0xc001d34ee0}, 0x0) honnef.co/go/tools@v0.5.1/go/ir/methods.go:166 +0xdf honnef.co/go/tools/go/ir.(Program).needMethodsOf(0xc001963860, {0xa5adb0?, 0xc001d34ee0?}) honnef.co/go/tools@v0.5.1/go/ir/methods.go:148 +0x70 honnef.co/go/tools/go/ir.(Package).build(0xc0039dcb40) honnef.co/go/tools@v0.5.1/go/ir/builder.go:3348 +0xf6 sync.(Once).doSlow(0xc001963860?, 0xc000abf620?) sync/once.go:76 +0xb4 sync.(Once).Do(...) sync/once.go:67 honnef.co/go/tools/go/ir.(Package).Build(...) honnef.co/go/tools@v0.5.1/go/ir/builder.go:3336 honnef.co/go/tools/internal/passes/buildir.run(0xc002585880) honnef.co/go/tools@v0.5.1/internal/passes/buildir/buildir.go:86 +0x18b honnef.co/go/tools/lintcmd/runner.(analyzerRunner).do(0xc004253890, {0xa5fbf8?, 0xc001bdd5e0}) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:988 +0x71b honnef.co/go/tools/lintcmd/runner.genericHandle({0xa5fbf8, 0xc001bdd5e0}, {0xa5fbf8?, 0xc001bdd540?}, 0xc00176f880, 0x0, 0xc00088b5e8) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:813 +0x11f honnef.co/go/tools/lintcmd/runner.(subrunner).runAnalyzers(0xc000c9a640, 0xc000b31b00, 0xc0003085a0) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:1061 +0x6fe honnef.co/go/tools/lintcmd/runner.(subrunner).doUncached(0xc000c9a640, 0xc000b31b00) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:716 +0x1c9 honnef.co/go/tools/lintcmd/runner.(subrunner).do(0xc000c9a640, {0xa5fc40?, 0xc000b31b00}) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:573 +0x968 honnef.co/go/tools/lintcmd/runner.(Runner).Run.func2({0xa5fc40?, 0xc000b31b00?}) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:1227 +0x2a honnef.co/go/tools/lintcmd/runner.genericHandle({0xa5fc40, 0xc000b31b00}, {0xa5fc40?, 0xc0006625a0?}, 0xc0031ac000, 0xc0004b80a0, 0xc0031324b0) honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:813 +0x11f created by honnef.co/go/tools/lintcmd/runner.(*Runner).Run in goroutine 1 honnef.co/go/tools@v0.5.1/lintcmd/runner/runner.go:1226 +0x3d4` image image

timothy-king commented 2 months ago

go/types #68877 ?