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

changeset 196
1ca2dc8584e1
parent 158
c6e3fc6dda61
child 202
3b2c55b7bd01
equal deleted inserted replaced
195:83c59a9d4b94 196:1ca2dc8584e1
1161 Type mtres = mt.getReturnType(); 1161 Type mtres = mt.getReturnType();
1162 Type otres = types.subst(ot.getReturnType(), otvars, mtvars); 1162 Type otres = types.subst(ot.getReturnType(), otvars, mtvars);
1163 1163
1164 overrideWarner.warned = false; 1164 overrideWarner.warned = false;
1165 boolean resultTypesOK = 1165 boolean resultTypesOK =
1166 types.returnTypeSubstitutable(mt, ot, otres, overrideWarner); 1166 types.covariantReturnType(mtres, otres, overrideWarner);
1167 if (!resultTypesOK) { 1167 if (!resultTypesOK) {
1168 if (!source.allowCovariantReturns() && 1168 if (!source.allowCovariantReturns() &&
1169 m.owner != origin && 1169 m.owner != origin &&
1170 m.owner.isSubClass(other.owner, types)) { 1170 m.owner.isSubClass(other.owner, types)) {
1171 // allow limited interoperability with covariant returns 1171 // allow limited interoperability with covariant returns

mercurial