I'm not really sure what the right answer to be here. Technically this function is indeed autogenerated, as it is a closure capturing the receiver. This is also seen in the synthetic name (-fm). So I would expect a synthetic location. Both the runtime and reflect packages' documentation doesn't mention what is expected in this case.
We may be able to restore the old behavior, but I'm not sure that is best. If we want to give the location of the definition, perhaps we also want to give the original method name instead of the synthetic -fm name?
If you use the method that does not capture the receiver, like
v := reflect.ValueOf((*s).f)
It prints the actual line number. Would that be okay? Thanks.
In my case using (*s).f does not seem feasible, as I receive functions from library users and they may provide any kind. Later, I print file and line of that function to help users to diagnose the problems, unfortunately <autogenerated> is not helpful in such scenario.
If there is a workaround or a more reliable solution to resolve arbitrary function into a place of origin in code, I would be happy to use it.