src/share/classes/com/sun/tools/javac/api/JavacTrees.java

changeset 1853
831467c4c6a7
parent 1734
8dd528992c15
child 1917
2fbe77c38802
equal deleted inserted replaced
1852:bf020de5a6db 1853:831467c4c6a7
67 import com.sun.tools.javac.code.Type.ArrayType; 67 import com.sun.tools.javac.code.Type.ArrayType;
68 import com.sun.tools.javac.code.Type.ClassType; 68 import com.sun.tools.javac.code.Type.ClassType;
69 import com.sun.tools.javac.code.Type.ErrorType; 69 import com.sun.tools.javac.code.Type.ErrorType;
70 import com.sun.tools.javac.code.Type.UnionClassType; 70 import com.sun.tools.javac.code.Type.UnionClassType;
71 import com.sun.tools.javac.code.Types; 71 import com.sun.tools.javac.code.Types;
72 import com.sun.tools.javac.code.TypeTag;
72 import com.sun.tools.javac.code.Types.TypeRelation; 73 import com.sun.tools.javac.code.Types.TypeRelation;
73 import com.sun.tools.javac.comp.Attr; 74 import com.sun.tools.javac.comp.Attr;
74 import com.sun.tools.javac.comp.AttrContext; 75 import com.sun.tools.javac.comp.AttrContext;
75 import com.sun.tools.javac.comp.Enter; 76 import com.sun.tools.javac.comp.Enter;
76 import com.sun.tools.javac.comp.Env; 77 import com.sun.tools.javac.comp.Env;
651 return visit(s, t); 652 return visit(s, t);
652 653
653 switch (t.getTag()) { 654 switch (t.getTag()) {
654 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT: 655 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
655 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE: 656 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE:
656 return t.getTag() == s.getTag(); 657 return t.hasTag(s.getTag());
657
658 default: 658 default:
659 throw new AssertionError("fuzzyMatcher " + t.getTag()); 659 throw new AssertionError("fuzzyMatcher " + t.getTag());
660 } 660 }
661 } 661 }
662 662
666 return true; 666 return true;
667 667
668 if (s.isPartial()) 668 if (s.isPartial())
669 return visit(s, t); 669 return visit(s, t);
670 670
671 return s.getTag() == ARRAY 671 return s.hasTag(ARRAY)
672 && visit(t.elemtype, types.elemtype(s)); 672 && visit(t.elemtype, types.elemtype(s));
673 } 673 }
674 674
675 @Override 675 @Override
676 public Boolean visitClassType(ClassType t, Type s) { 676 public Boolean visitClassType(ClassType t, Type s) {
683 return t.tsym == s.tsym; 683 return t.tsym == s.tsym;
684 } 684 }
685 685
686 @Override 686 @Override
687 public Boolean visitErrorType(ErrorType t, Type s) { 687 public Boolean visitErrorType(ErrorType t, Type s) {
688 return s.getTag() == CLASS 688 return s.hasTag(CLASS)
689 && t.tsym.name == ((ClassType) s).tsym.name; 689 && t.tsym.name == ((ClassType) s).tsym.name;
690 } 690 }
691 }; 691 };
692 692
693 public TypeMirror getTypeMirror(TreePath path) { 693 public TypeMirror getTypeMirror(TreePath path) {

mercurial