cmd/compile: incorrect/confusing pkg prefix on unexported fields of anonymous struct #70963
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Debugging
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go 1.23
Output of
go env
in your module/workspace:What did you do?
I observed that in DWARF, anonymous struct type names carry unexported field names with package path prefixes. See the below program:
https://go.dev/play/p/96lCdrfHAh3
The type is:
But in DWARF, the type is:
What did you see happen?
In dwarf, the fields in anonymous struct have a package path prefix.
What did you expect to see?
I expected in dwarf for the type to have the same name as it has in pclntab and upon runtime reflection. Maybe there's a good reason for this, but it's not obvious what that might be.
This has caused confusion for users of delve (go-delve/delve#1521).
The text was updated successfully, but these errors were encountered: