Re: [go-nuts] Generics: Using runtime.FuncForPC() to get method name doesn't *seem* to work

2022-11-07 Thread John
Note for posterity: Other methods of method equality fall in the same problem, such as detailed in: https://stackoverflow.com/questions/9643205/how-do-i-compare-two-functions-for-pointer-equality-in-the-latest-go-weekly Proof: https://go.dev/play/p/aeeRKfderY2 On Monday, November 7, 2022 at

Re: [go-nuts] Generics: Using runtime.FuncForPC() to get method name doesn't *seem* to work

2022-11-07 Thread John
Thanks Ian for being generous with your time in answering this. I'll see if I can drum up another way to make that check work. Cheers and have a good rest of your day. On Monday, November 7, 2022 at 10:02:28 AM UTC-8 Ian Lance Taylor wrote: > On Mon, Nov 7, 2022 at 9:24 AM John wrote: > > >

Re: [go-nuts] Generics: Using runtime.FuncForPC() to get method name doesn't *seem* to work

2022-11-07 Thread Ian Lance Taylor
On Mon, Nov 7, 2022 at 9:24 AM John wrote: > > Or maybe I'm just doing something wrong. > > I have a struct implementing generics where methods return the next method to > execute. > > For tests, I wanted to make sure the returned method was the one expected, so > I was using this: > >