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

changeset 202
3b2c55b7bd01
parent 196
1ca2dc8584e1
child 229
03bcd66bd8e7
child 236
84a18d7da478
equal deleted inserted replaced
201:e3930187199c 202:3b2c55b7bd01
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.covariantReturnType(mtres, otres, overrideWarner); 1166 types.returnTypeSubstitutable(mt, ot, 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