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

changeset 299
22872b24d38c
parent 288
d402db1005ad
child 396
dda7e13f09fb
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Jun 16 10:46:16 2009 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Jun 16 10:46:37 2009 +0100
     1.3 @@ -1066,6 +1066,21 @@
     1.4              return qtype.isErroneous();
     1.5          }
     1.6  
     1.7 +        /**
     1.8 +         * Replaces this ForAll's typevars with a set of concrete Java types
     1.9 +         * and returns the instantiated generic type. Subclasses might override
    1.10 +         * in order to check that the list of types is a valid instantiation
    1.11 +         * of the ForAll's typevars.
    1.12 +         *
    1.13 +         * @param actuals list of actual types
    1.14 +         * @param types types instance
    1.15 +         * @return qtype where all occurrences of tvars are replaced
    1.16 +         * by types in actuals
    1.17 +         */
    1.18 +        public Type inst(List<Type> actuals, Types types) {
    1.19 +            return types.subst(qtype, tvars, actuals);
    1.20 +        }
    1.21 +
    1.22          public Type map(Mapping f) {
    1.23              return f.apply(qtype);
    1.24          }

mercurial