Re: array and diamond

2011-12-11 Thread Maurizio Cimadamore
On 11/12/11 15:21, Rémi Forax wrote: On 12/10/2011 12:38 PM, maurizio cimadamore wrote: On 09-Dec-11 10:56 PM, Rémi Forax wrote: Is there a reason why the diamond syntax can't be used with an array ? List[] list = new List<>[12]; Because the current inference rules would end up inferring: L

Re: array and diamond

2011-12-11 Thread Rémi Forax
On 12/10/2011 12:38 PM, maurizio cimadamore wrote: On 09-Dec-11 10:56 PM, Rémi Forax wrote: Is there a reason why the diamond syntax can't be used with an array ? List[] list = new List<>[12]; Because the current inference rules would end up inferring: List[] list = new List[12]; If you spe

Re: array and diamond

2011-12-11 Thread Rémi Forax
On 12/11/2011 12:16 PM, David Holmes wrote: On 10/12/2011 8:56 AM, Rémi Forax wrote: Is there a reason why the diamond syntax can't be used with an array ? List[] list = new List<>[12]; It can in Java 7. That's the bug that we just discussed in regard to the java.util.concurrent code cleanup

Re: array and diamond

2011-12-11 Thread David Holmes
On 10/12/2011 8:56 AM, Rémi Forax wrote: Is there a reason why the diamond syntax can't be used with an array ? List[] list = new List<>[12]; It can in Java 7. That's the bug that we just discussed in regard to the java.util.concurrent code cleanup where I suggested to use: HashEntry[] new

Re: array and diamond

2011-12-10 Thread maurizio cimadamore
On 09-Dec-11 10:56 PM, Rémi Forax wrote: Is there a reason why the diamond syntax can't be used with an array ? List[] list = new List<>[12]; Because the current inference rules would end up inferring: List[] list = new List[12]; If you special-cased diamond on arrays so that it is inferred