I found one more issue like #49436 so I decided to write a program to find all of them. The program is https://github.com/aarzilli/badlngenerics/.
When run with test/typeparam/*.go it produces https://gist.github.com/aarzilli/7c4ba1e87e986f0ec1a89cdec455392a as output. The output format is
append.go:29 0x454e8d main._Append
which means that after compiling append.go with -gcflags='-N -l' instruction 0x454e8d, which belongs to an instantiation of main._Append, is assigned to line 29 of append.go, which happens to be outside of the body of main._Append in the source file.
Some of the output could be false positives but I've spot-checked some of it and it looks like it's detecting real problems.
There's a few of them.
Tested with:
go version devel go1.18-c49627e81b Thu Nov 11 11:47:33 2021 +0000 linux/amd64
cc @dr2chase
I found one more issue like #49436 so I decided to write a program to find all of them. The program is https://github.com/aarzilli/badlngenerics/.
When run with
test/typeparam/*.goit produces https://gist.github.com/aarzilli/7c4ba1e87e986f0ec1a89cdec455392a as output. The output format iswhich means that after compiling append.go with
-gcflags='-N -l'instruction 0x454e8d, which belongs to an instantiation of main._Append, is assigned to line 29 of append.go, which happens to be outside of the body of main._Append in the source file.Some of the output could be false positives but I've spot-checked some of it and it looks like it's detecting real problems.
There's a few of them.
Tested with:
cc @dr2chase