great, thanks brian, works like a charm. surprisingly, even works in my specific use case calling it like "interfaceFunc[T](x)" generically without being specific like "[string]", wondering why the compiler's inference is like that? is it a flaw or just a limitation of the concept per se?
On Monday, June 20, 2022 at 8:44:06 AM UTC-4 Brian Candler wrote: > Type inference doesn't work in all cases. When required, just be explicit: > > interfaceFunc[string](x) > > https://go.dev/play/p/j66sXsfMUBl > > On Monday, 20 June 2022 at 13:06:57 UTC+1 Mike Andrews wrote: > >> anyone know why this simple case doesn't compile? i'm trying to call a >> function defined for generic interface type, which fails to compile for >> struct instance: https://go.dev/play/p/Y3Gdr2ILpK4 >> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/700007a0-d54b-4c58-824f-df5d9ee12866n%40googlegroups.com.