array and diamond (original) (raw)
maurizio cimadamore maurizio.cimadamore at oracle.com
Sat Dec 10 11:38:22 UTC 2011
- Previous message: array and diamond
- Next message: array and diamond
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 as:
List[] list = new List[12];
Then it would be safe.
Maurizio
Rémi
- Previous message: array and diamond
- Next message: array and diamond
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]