How can I repeat the same generics type in the parameters? I'm getting a "does not match inferred type" error for the code below.
func Print[T Worker](a T, b T) {
fmt.Println(a.Work() + b.Work())
}
func main() {
c1 := coder{}
t1 := tester{}
Print(c1, t1)
}
Compiler Error: type tester of t1 does not match inferred type coder for T
If I flip the parameters that I pass, then the error is now for the second one.
Print(c1, t1)
Compiler Error: type coder of c1 does not match inferred type tester for T)