-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
The symbol names currently produced by the compiler for generic function instantiations can not be parsed by debug/gosym (or any simple parser for that matter).
For example:
func testfunction[T any](arg T) {
fmt.Println(arg)
}
func main() {
testfunction(3)
}
Produces the symbol main.testfunction[.shape.int]
for which gosym will return:
PackageName: "main"
ReceiverName: "testfunction[.shape"
BaseName: "int]"
instead of:
PackageName: "main"
ReceiverName: ""
BaseName: "testfunction[.shape.int]"
Parsing symbol names is further complicated by generic method instantiations:
type S[T any] struct {
x T
}
func (s *S[T]) testfunction() {
fmt.Println(s.x)
}
Will produce the symbol main.(*S[.shape.int]).testfunction
, so just looking for the first .
instead of the last one doesn't work either.
Referencing issue #37762 here since its making an effort to fix a bug in this area.
cuonglm
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.