'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:
+12
-11
@@ -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(f, g)) return true;
|
||||||
if (OverridingUtil.overrides(g, f)) return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user