langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 24612 75dc732b45af
parent 24609 5139d892e270
child 24794 22946bb4c27d
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue May 27 14:23:55 2014 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue May 27 16:32:56 2014 -0600
@@ -1176,7 +1176,7 @@
             //the Formal Parameter of a for-each loop is not in the scope when
             //attributing the for-each expression; we mimick this by attributing
             //the for-each expression first (against original scope).
-            Type exprType = types.upperBound(attribExpr(tree.expr, loopEnv));
+            Type exprType = types.cvarUpperBound(attribExpr(tree.expr, loopEnv));
             attribStat(tree.var, loopEnv);
             chk.checkNonVoid(tree.pos(), exprType);
             Type elemtype = types.elemtype(exprType); // perhaps expr is an array?
@@ -1193,7 +1193,7 @@
                     List<Type> iterableParams = base.allparams();
                     elemtype = iterableParams.isEmpty()
                         ? syms.objectType
-                        : types.upperBound(iterableParams.head);
+                        : types.wildUpperBound(iterableParams.head);
                 }
             }
             chk.checkType(tree.expr.pos(), elemtype, tree.var.sym.type);