Fixed direction of substitution when checking bounds of type parameters.

This commit is contained in:
Evgeny Gerashchenko
2012-12-04 18:10:07 +04:00
parent d7624aa7b6
commit 95c9c4c0c4
6 changed files with 52 additions and 2 deletions
@@ -116,10 +116,10 @@ public class AlternativeMethodSignatureData extends ElementAlternativeSignatureD
for (TypeParameterDescriptor parameter : methodTypeParameters) {
int index = parameter.getIndex();
JetType substituted = substitutor.substitute(altTypeParameters.get(index).getUpperBoundsAsType(), Variance.INVARIANT);
JetType substituted = substitutor.substitute(parameter.getUpperBoundsAsType(), Variance.INVARIANT);
assert substituted != null;
if (!TypeUtils.equalTypes(substituted, parameter.getUpperBoundsAsType())) {
if (!TypeUtils.equalTypes(substituted, altTypeParameters.get(index).getUpperBoundsAsType())) {
throw new AlternativeSignatureMismatchException(
"Type parameter's upper bound changed for method which overrides another: "
+ altTypeParameters.get(index).getUpperBoundsAsType() + ", was: " + parameter.getUpperBoundsAsType());