Lines 626-637
Link Here
|
626 |
break; |
626 |
break; |
627 |
case Binding.TYPE_PARAMETER : |
627 |
case Binding.TYPE_PARAMETER : |
628 |
final TypeVariableBinding variable = (TypeVariableBinding) this; |
628 |
final TypeVariableBinding variable = (TypeVariableBinding) this; |
629 |
if (variable.firstBound == null) // unbound variable |
|
|
630 |
return false; |
631 |
if (variable.isCapture()) { |
629 |
if (variable.isCapture()) { |
632 |
upperBound1 = variable.upperBound(); |
630 |
CaptureBinding capture = (CaptureBinding) variable; |
|
|
631 |
lowerBound1 = capture.lowerBound; |
632 |
if (lowerBound1 == null) { |
633 |
if (capture.firstBound == null) |
634 |
return false; |
635 |
upperBound1 = capture.firstBound; |
636 |
} |
633 |
break; |
637 |
break; |
634 |
} |
638 |
} |
|
|
639 |
if (variable.firstBound == null) // unbound variable |
640 |
return false; |
635 |
TypeBinding eliminatedType = (paramType.environment.convertEliminatingTypeVariables(variable, paramType.genericType(), rank, null)); |
641 |
TypeBinding eliminatedType = (paramType.environment.convertEliminatingTypeVariables(variable, paramType.genericType(), rank, null)); |
636 |
switch (eliminatedType.kind()) { |
642 |
switch (eliminatedType.kind()) { |
637 |
case Binding.WILDCARD_TYPE : |
643 |
case Binding.WILDCARD_TYPE : |
Lines 671-682
Link Here
|
671 |
break; |
677 |
break; |
672 |
case Binding.TYPE_PARAMETER : |
678 |
case Binding.TYPE_PARAMETER : |
673 |
TypeVariableBinding otherVariable = (TypeVariableBinding) otherArgument; |
679 |
TypeVariableBinding otherVariable = (TypeVariableBinding) otherArgument; |
674 |
if (otherVariable.firstBound == null) // unbound variable |
|
|
675 |
return false; |
676 |
if (otherVariable.isCapture()) { |
680 |
if (otherVariable.isCapture()) { |
677 |
upperBound2 = otherVariable.upperBound(); // TODO need to improve for otherBounds |
681 |
CaptureBinding otherCapture = (CaptureBinding) otherVariable; |
|
|
682 |
lowerBound2 = otherCapture.lowerBound; |
683 |
if (lowerBound2 == null) { |
684 |
if (otherCapture.firstBound == null) |
685 |
return false; |
686 |
upperBound2 = otherCapture.firstBound; |
687 |
} |
678 |
break; |
688 |
break; |
679 |
} |
689 |
} |
|
|
690 |
if (otherVariable.firstBound == null) // unbound variable |
691 |
return false; |
680 |
TypeBinding otherEliminatedType = (paramType.environment.convertEliminatingTypeVariables(otherVariable, paramType.genericType(), rank, null)); |
692 |
TypeBinding otherEliminatedType = (paramType.environment.convertEliminatingTypeVariables(otherVariable, paramType.genericType(), rank, null)); |
681 |
switch (otherEliminatedType.kind()) { |
693 |
switch (otherEliminatedType.kind()) { |
682 |
case Binding.WILDCARD_TYPE : |
694 |
case Binding.WILDCARD_TYPE : |
Lines 701-715
Link Here
|
701 |
|
713 |
|
702 |
} else if (upperBound2 != null) { |
714 |
} else if (upperBound2 != null) { |
703 |
return !lowerBound1.isCompatibleWith(upperBound2); |
715 |
return !lowerBound1.isCompatibleWith(upperBound2); |
704 |
// return lowerBound1.isProvableDistinctSubType(upperBound2); |
|
|
705 |
} else { |
716 |
} else { |
706 |
return !lowerBound1.isCompatibleWith(otherArgument); |
717 |
return !lowerBound1.isCompatibleWith(otherArgument); |
707 |
// return lowerBound1.isProvableDistinctSubType(otherArgument); |
|
|
708 |
} |
718 |
} |
709 |
} else if (upperBound1 != null) { |
719 |
} else if (upperBound1 != null) { |
710 |
if (lowerBound2 != null) { |
720 |
if (lowerBound2 != null) { |
711 |
return !lowerBound2.isCompatibleWith(upperBound1); |
721 |
return !lowerBound2.isCompatibleWith(upperBound1); |
712 |
//return lowerBound2.isProvableDistinctSubType(upperBound1); |
|
|
713 |
} else if (upperBound2 != null) { |
722 |
} else if (upperBound2 != null) { |
714 |
return upperBound1.isProvableDistinctSubType(upperBound2) |
723 |
return upperBound1.isProvableDistinctSubType(upperBound2) |
715 |
&& upperBound2.isProvableDistinctSubType(upperBound1); |
724 |
&& upperBound2.isProvableDistinctSubType(upperBound1); |
Lines 719-725
Link Here
|
719 |
} else { |
728 |
} else { |
720 |
if (lowerBound2 != null) { |
729 |
if (lowerBound2 != null) { |
721 |
return !lowerBound2.isCompatibleWith(this); |
730 |
return !lowerBound2.isCompatibleWith(this); |
722 |
// return lowerBound2.isProvableDistinctSubType(this); |
|
|
723 |
} else if (upperBound2 != null) { |
731 |
} else if (upperBound2 != null) { |
724 |
return this.isProvableDistinctSubType(upperBound2); |
732 |
return this.isProvableDistinctSubType(upperBound2); |
725 |
} else { |
733 |
} else { |