Community
Participate
Working Groups
BETA_JAVA7 import java.util.ArrayList; import java.util.List; public class DiamondErr2 { List<?> m() { return new ArrayList<>(""); } } The error message "Cannot infer elided type(s)" should be expressed with simpler words, e.g. "Cannot infer type arguments". We also avoid the plural (s) in parentheses. In places where duplicating all messages is overkill, just use the plural (like most compiler messages already do). Olivier, I think the readability of the spec would also improve if the word "elide" would be replaced by "omit" (which is generally used in JLS3).
I think it is too late to change "elide" to "omit". I'll ask anyway. Right now the error message is matching the wording used in the specification for diamond. Note that javac is reporting: error: cannot infer type arguments for ArrayList<> which is closer to what you request.
Created attachment 197883 [details] Proposed patch I'll ignore for the moment the point that java itself is fast becoming elitist so much so that only mathematicians will be using certain parts of the language (and will be furiously debating, using the most arcane of arguments, the validity or lack of a disputed code snippet) :) We now use "Cannot infer type arguments for {0}" For the record there are a few messages using the (s) style of ambiguous pluralism, but I changed the current message anyways.
Released in BETA_JAVA7 branch.
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.