--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Wed Jul 05 16:51:35 2017 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon May 04 21:04:04 2009 -0700
@@ -207,6 +207,12 @@
* @param found The type that was found.
*/
Type typeTagError(DiagnosticPosition pos, Object required, Object found) {
+ // this error used to be raised by the parser,
+ // but has been delayed to this point:
+ if (found instanceof Type && ((Type)found).tag == VOID) {
+ log.error(pos, "illegal.start.of.type");
+ return syms.errType;
+ }
log.error(pos, "type.found.req", found, required);
return types.createErrorType(found instanceof Type ? (Type)found : syms.errType);
}
@@ -547,6 +553,20 @@
}
}
+ /** Check that each type is a reference type, i.e. a class, interface or array type
+ * or a type variable.
+ * @param trees Original trees, used for error reporting.
+ * @param types The types to be checked.
+ */
+ List<Type> checkRefTypes(List<JCExpression> trees, List<Type> types) {
+ List<JCExpression> tl = trees;
+ for (List<Type> l = types; l.nonEmpty(); l = l.tail) {
+ l.head = checkRefType(tl.head.pos(), l.head);
+ tl = tl.tail;
+ }
+ return types;
+ }
+
/** Check that type is a null or reference type.
* @param pos Position to be used for error reporting.
* @param t The type to be checked.