src/share/classes/com/sun/tools/javac/comp/Check.java

changeset 561
e9ef849ae0ed
parent 547
04cf82179fa7
child 564
1d587ef8bf56
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu May 13 11:30:28 2010 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed May 19 16:41:57 2010 +0100
     1.3 @@ -915,7 +915,7 @@
     1.4                  List<Type> actuals = tree.type.allparams();
     1.5                  List<JCExpression> args = tree.arguments;
     1.6                  List<Type> forms = tree.type.tsym.type.getTypeArguments();
     1.7 -                ListBuffer<TypeVar> tvars_buf = new ListBuffer<TypeVar>();
     1.8 +                ListBuffer<Type> tvars_buf = new ListBuffer<Type>();
     1.9  
    1.10                  // For matching pairs of actual argument types `a' and
    1.11                  // formal type parameters with declared bound `b' ...
    1.12 @@ -946,12 +946,15 @@
    1.13                  }
    1.14  
    1.15                  args = tree.arguments;
    1.16 -                List<TypeVar> tvars = tvars_buf.toList();
    1.17 +                List<Type> tvars = tvars_buf.toList();
    1.18  
    1.19                  while (args.nonEmpty() && tvars.nonEmpty()) {
    1.20 +                    Type actual = types.subst(args.head.type,
    1.21 +                        tree.type.tsym.type.getTypeArguments(),
    1.22 +                        tvars_buf.toList());
    1.23                      checkExtends(args.head.pos(),
    1.24 -                                 args.head.type,
    1.25 -                                 tvars.head);
    1.26 +                                 actual,
    1.27 +                                 (TypeVar)tvars.head);
    1.28                      args = args.tail;
    1.29                      tvars = tvars.tail;
    1.30                  }

mercurial