gccgo: confusing closure names #29690
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?Linux/AMD64
What did you do?
Built with gccgo, this program prints
The closures on line 7 and 8 are different functions, yet have the same name, which is confusing. It is ok that closures have somewhat artificial names, but it is super confusing if different closures have the name.
It appears to me (without checking the source code) that if the closures are defined in global scope or inside a function (NOT method), they are properly named as
package_name.funcN
orpackage_name.function_name.funcN
with properN
. However, if they are defined in methods, they are all namedpackage_name.funcN
withN
starting from 1 in each method. In this case, the two closures are defined in two different methods, and both namedmain.func1
.cc @ianlancetaylor @thanm
The text was updated successfully, but these errors were encountered: