# HG changeset patch # User ikrylov # Date 1418663965 -14400 # Node ID 20eebcd42dae1a37a9dd747ec641b8f290ad3cea # Parent ce47786cb1e1404e9e67bbefc182a5ac81672106 6938454: Unable to determine generic type in program that compiles under Java 6 Reviewed-by: aph Contributed-by: nikgor diff -r ce47786cb1e1 -r 20eebcd42dae src/share/classes/com/sun/tools/javac/comp/Infer.java --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java Wed Oct 08 19:12:53 2014 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java Mon Dec 15 21:19:25 2014 +0400 @@ -262,7 +262,7 @@ UndetVar uv = (UndetVar) l.head; TypeVar tv = (TypeVar)uv.qtype; ListBuffer hibounds = new ListBuffer(); - for (Type t : that.getConstraints(tv, ConstraintKind.EXTENDS).prependList(types.getBounds(tv))) { + for (Type t : that.getConstraints(tv, ConstraintKind.EXTENDS)) { if (!t.containsSome(that.tvars) && t.tag != BOT) { hibounds.append(t); } @@ -286,7 +286,6 @@ // check bounds List targs = Type.map(undetvars, getInstFun); targs = types.subst(targs, that.tvars, targs); - checkWithinBounds(that.tvars, targs, warn); return chk.checkType(warn.pos(), that.inst(targs, types), to); } @@ -402,7 +401,7 @@ UndetVar uv = (UndetVar)t; if (uv.qtype == tv) { switch (ck) { - case EXTENDS: return uv.hibounds; + case EXTENDS: return uv.hibounds.appendList(types.subst(types.getBounds(tv), all_tvars, inferredTypes)); case SUPER: return uv.lobounds; case EQUAL: return uv.inst != null ? List.of(uv.inst) : List.nil(); }