On Wednesday, 6 January 2021 at 12:40:24 UTC tapi...@gmail.com wrote: > func blah[T1]T2 (x T1) T2 { ... } >> >> x := blah[int]string(123) >> > > I didn't see anyone propose this syntax from the above comments. >
To quote the message which started the thread: *I think something like sync.Map[string]linked.List string is more readable than sync.Map[string, linked.List[string]].* *I propose putting the last type parameter to a generic type after the square brackets and omitting them when there is only one type parameter.* I accept it was talking about type parameters to types, not type parameters to functions (although it would be weird if they were different). But even if you think only about types, it doesn't make much sense to make the last type parameter distinct from the others. Another silly example: # current type Circle[T1,T2 any] struct { x,y,radius T1 color T2 } type myCircle Circle[float64,string] # proposed type Circle[T1 any]T2 any struct { x,y,radius T1 color T2 } type myCircle Circle[float64]string -- 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/840ac695-1ff6-4835-87c0-9334ad97fa25n%40googlegroups.com.