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

changeset 1251
6f0ed5a89c25
parent 988
7ae6c0fd479b
child 1268
af6a4c24f4e3
equal deleted inserted replaced
1250:c35b158e2290 1251:6f0ed5a89c25
1145 public Type inst(List<Type> actuals, Types types) { 1145 public Type inst(List<Type> actuals, Types types) {
1146 return types.subst(qtype, tvars, actuals); 1146 return types.subst(qtype, tvars, actuals);
1147 } 1147 }
1148 1148
1149 /** 1149 /**
1150 * Kind of type-constraint derived during type inference
1151 */
1152 public enum ConstraintKind {
1153 /**
1154 * upper bound constraint (a type variable must be instantiated
1155 * with a type T, where T is a subtype of all the types specified by
1156 * its EXTENDS constraints).
1157 */
1158 EXTENDS,
1159 /**
1160 * lower bound constraint (a type variable must be instantiated
1161 * with a type T, where T is a supertype of all the types specified by
1162 * its SUPER constraints).
1163 */
1164 SUPER,
1165 /**
1166 * equality constraint (a type variable must be instantiated to the type
1167 * specified by its EQUAL constraint.
1168 */
1169 EQUAL;
1170 }
1171
1172 /**
1173 * Get the type-constraints of a given kind for a given type-variable of 1150 * Get the type-constraints of a given kind for a given type-variable of
1174 * this ForAll type. Subclasses should override in order to return more 1151 * this ForAll type. Subclasses should override in order to return more
1175 * accurate sets of constraints. 1152 * accurate sets of constraints.
1176 * 1153 *
1177 * @param tv the type-variable for which the constraint is to be retrieved 1154 * @param tv the type-variable for which the constraint is to be retrieved
1178 * @param ck the constraint kind to be retrieved 1155 * @param ck the constraint kind to be retrieved
1179 * @return the list of types specified by the selected constraint 1156 * @return the list of types specified by the selected constraint
1180 */ 1157 */
1181 public List<Type> getConstraints(TypeVar tv, ConstraintKind ck) { 1158 public List<Type> undetvars() {
1182 return List.nil(); 1159 return List.nil();
1183 } 1160 }
1184 1161
1185 public Type map(Mapping f) { 1162 public Type map(Mapping f) {
1186 return f.apply(qtype); 1163 return f.apply(qtype);
1218 * inference. 1195 * inference.
1219 */ 1196 */
1220 public static class UndetVar extends DelegatedType { 1197 public static class UndetVar extends DelegatedType {
1221 public List<Type> lobounds = List.nil(); 1198 public List<Type> lobounds = List.nil();
1222 public List<Type> hibounds = List.nil(); 1199 public List<Type> hibounds = List.nil();
1200 public List<Type> eq = List.nil();
1223 public Type inst = null; 1201 public Type inst = null;
1224 1202
1225 @Override 1203 @Override
1226 public <R,S> R accept(Type.Visitor<R,S> v, S s) { 1204 public <R,S> R accept(Type.Visitor<R,S> v, S s) {
1227 return v.visitUndetVar(this, s); 1205 return v.visitUndetVar(this, s);

mercurial