586 |
586 |
587 switch (t.tag) { |
587 switch (t.tag) { |
588 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT: |
588 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT: |
589 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE: |
589 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE: |
590 return t.tag == s.tag; |
590 return t.tag == s.tag; |
591 case TYPEVAR: |
591 case TYPEVAR: { |
592 return s.isSuperBound() |
592 if (s.tag == TYPEVAR) { |
593 && !s.isExtendsBound() |
593 //type-substitution does not preserve type-var types |
594 && visit(t, upperBound(s)); |
594 //check that type var symbols and bounds are indeed the same |
|
595 return t.tsym == s.tsym && |
|
596 visit(t.getUpperBound(), s.getUpperBound()); |
|
597 } |
|
598 else { |
|
599 //special case for s == ? super X, where upper(s) = u |
|
600 //check that u == t, where u has been set by Type.withTypeVar |
|
601 return s.isSuperBound() && |
|
602 !s.isExtendsBound() && |
|
603 visit(t, upperBound(s)); |
|
604 } |
|
605 } |
595 default: |
606 default: |
596 throw new AssertionError("isSameType " + t.tag); |
607 throw new AssertionError("isSameType " + t.tag); |
597 } |
608 } |
598 } |
609 } |
599 |
610 |