equal
deleted
inserted
replaced
1008 : a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym; |
1008 : a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym; |
1009 if (!disjointTypes(aHigh.allparams(), highSub.allparams()) |
1009 if (!disjointTypes(aHigh.allparams(), highSub.allparams()) |
1010 && !disjointTypes(aHigh.allparams(), lowSub.allparams()) |
1010 && !disjointTypes(aHigh.allparams(), lowSub.allparams()) |
1011 && !disjointTypes(aLow.allparams(), highSub.allparams()) |
1011 && !disjointTypes(aLow.allparams(), highSub.allparams()) |
1012 && !disjointTypes(aLow.allparams(), lowSub.allparams())) { |
1012 && !disjointTypes(aLow.allparams(), lowSub.allparams())) { |
1013 if (upcast ? giveWarning(a, highSub) || giveWarning(a, lowSub) |
1013 if (upcast ? giveWarning(a, b) : |
1014 : giveWarning(highSub, a) || giveWarning(lowSub, a)) |
1014 giveWarning(b, a)) |
1015 warnStack.head.warnUnchecked(); |
1015 warnStack.head.warnUnchecked(); |
1016 return true; |
1016 return true; |
1017 } |
1017 } |
1018 } |
1018 } |
1019 if (isReifiable(s)) |
1019 if (isReifiable(s)) |
3222 warn.warnUnchecked(); |
3222 warn.warnUnchecked(); |
3223 return true; |
3223 return true; |
3224 } |
3224 } |
3225 |
3225 |
3226 private boolean giveWarning(Type from, Type to) { |
3226 private boolean giveWarning(Type from, Type to) { |
3227 // To and from are (possibly different) parameterizations |
3227 Type subFrom = asSub(from, to.tsym); |
3228 // of the same class or interface |
3228 return to.isParameterized() && |
3229 return to.isParameterized() && !containsType(to.allparams(), from.allparams()); |
3229 (!(isUnbounded(to) || |
|
3230 isSubtype(from, to) || |
|
3231 ((subFrom != null) && isSameType(subFrom, to)))); |
3230 } |
3232 } |
3231 |
3233 |
3232 private List<Type> superClosure(Type t, Type s) { |
3234 private List<Type> superClosure(Type t, Type s) { |
3233 List<Type> cl = List.nil(); |
3235 List<Type> cl = List.nil(); |
3234 for (List<Type> l = interfaces(t); l.nonEmpty(); l = l.tail) { |
3236 for (List<Type> l = interfaces(t); l.nonEmpty(); l = l.tail) { |