src/share/classes/com/sun/tools/javac/code/Types.java

changeset 561
e9ef849ae0ed
parent 507
dbcba45123cd
child 563
eb849389ae2c
equal deleted inserted replaced
560:ebf09be0222c 561:e9ef849ae0ed
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

mercurial