src/share/classes/com/sun/tools/javac/code/Types.java

changeset 846
17bafae67e9d
parent 816
7c537f4298fb
child 858
96d4226bdd60
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Jan 28 12:03:49 2011 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Jan 28 12:06:21 2011 +0000
     1.3 @@ -2259,6 +2259,13 @@
     1.4  
     1.5          @Override
     1.6          public Type visitForAll(ForAll t, Void ignored) {
     1.7 +            if (Type.containsAny(to, t.tvars)) {
     1.8 +                //perform alpha-renaming of free-variables in 't'
     1.9 +                //if 'to' types contain variables that are free in 't'
    1.10 +                List<Type> freevars = newInstances(t.tvars);
    1.11 +                t = new ForAll(freevars,
    1.12 +                        Types.this.subst(t.qtype, t.tvars, freevars));
    1.13 +            }
    1.14              List<Type> tvars1 = substBounds(t.tvars, from, to);
    1.15              Type qtype1 = subst(t.qtype);
    1.16              if (tvars1 == t.tvars && qtype1 == t.qtype) {

mercurial