1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Tue May 27 21:15:06 2014 +0100 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Tue May 27 17:30:48 2014 -0600 1.3 @@ -1175,7 +1175,7 @@ 1.4 //the Formal Parameter of a for-each loop is not in the scope when 1.5 //attributing the for-each expression; we mimick this by attributing 1.6 //the for-each expression first (against original scope). 1.7 - Type exprType = types.upperBound(attribExpr(tree.expr, loopEnv)); 1.8 + Type exprType = types.cvarUpperBound(attribExpr(tree.expr, loopEnv)); 1.9 attribStat(tree.var, loopEnv); 1.10 chk.checkNonVoid(tree.pos(), exprType); 1.11 Type elemtype = types.elemtype(exprType); // perhaps expr is an array? 1.12 @@ -1192,7 +1192,7 @@ 1.13 List<Type> iterableParams = base.allparams(); 1.14 elemtype = iterableParams.isEmpty() 1.15 ? syms.objectType 1.16 - : types.upperBound(iterableParams.head); 1.17 + : types.wildUpperBound(iterableParams.head); 1.18 } 1.19 } 1.20 chk.checkType(tree.expr.pos(), elemtype, tree.var.sym.type);