'moreSpecific' fix

if both functions are generic, no need to check receiver and parameters
before recursive call with substituted bounds
This commit is contained in:
Svetlana Isakova
2012-11-08 19:53:15 +04:00
parent e7750c6dc7
commit eb5b551114
@@ -97,7 +97,18 @@ public class OverloadingConflictResolver {
}
}
if (discriminateGenericDescriptors && !isGeneric(f) && isGeneric(g)) return true;
boolean isGenericF = isGeneric(f);
boolean isGenericG = isGeneric(g);
if (discriminateGenericDescriptors) {
if (!isGenericF && isGenericG) return true;
if (isGenericF && !isGenericG) return false;
if (isGenericF && isGenericG) {
return moreSpecific(DescriptorUtils.substituteBounds(f), DescriptorUtils.substituteBounds(g), false);
}
}
if (OverridingUtil.overrides(f, g)) return true;
if (OverridingUtil.overrides(g, f)) return false;
@@ -179,16 +190,6 @@ public class OverloadingConflictResolver {
}
}
if (discriminateGenericDescriptors && isGeneric(f)) {
if (!isGeneric(g)) {
return false;
}
// g is generic, too
return moreSpecific(DescriptorUtils.substituteBounds(f), DescriptorUtils.substituteBounds(g), false);
}
return true;
}