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/19654bac-a086-4189-95c5-edf240ec35ecn%40googlegroups.com.