Re: [go-nuts] [generics] Type parameter inference in generic struct literals

2020-06-17 Thread Ian Lance Taylor
On Wed, Jun 17, 2020 at 9:35 AM tomas via golang-nuts wrote: > > Could type parameters be omitted when they could be inferred in struct > literals? https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#type-inference-for-composite-literals Ian -- You rece

[go-nuts] [generics] Type parameter inference in generic struct literals

2020-06-17 Thread tomas via golang-nuts
Hello all, Could type parameters be omitted when they could be inferred in struct literals? Here's a scenario that doesn't work today (https://go2goplay.golang.org/p/Jt5OGfLePuu) package main import ( "fmt" ) type BinaryTree(type T) struct { Value T Left, Right *BinaryTree(T) } func m