I don't think it's ambiguous at all.  We already do different things for 
different T in T{v}.  For slices, the slice is constructed and then each 
value is an item in the slice.  For structs, the struct is constructed and 
then the fields are filled out in declaration order.  We're just adding one 
more rule for single values which is actually really really obvious.

In fact, if anything, we're making it more consistent....

&[]int{5}  // this works
&[1]int{5} // this doesn't
&int{5} // this doesn't

Why not make those last two just work?

As xingtao zhao said, &[]interface{}{nil} is not ambiguous.  it's declaring 
a slice, so it fills in one item in the slice and returns the address of 
the slice.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to