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

changeset 2200
7c89d200781b
parent 2134
b0c086cd4520
child 2302
f35effa10297
equal deleted inserted replaced
2199:66bcd5d4b3d1 2200:7c89d200781b
968 // a clone of a ClassType that knows about the bounds of an intersection type. 968 // a clone of a ClassType that knows about the bounds of an intersection type.
969 public static class IntersectionClassType extends ClassType implements IntersectionType { 969 public static class IntersectionClassType extends ClassType implements IntersectionType {
970 970
971 public boolean allInterfaces; 971 public boolean allInterfaces;
972 972
973 public enum IntersectionKind {
974 EXPLICIT,
975 IMPLICT;
976 }
977
978 public IntersectionKind intersectionKind;
979
980 public IntersectionClassType(List<Type> bounds, ClassSymbol csym, boolean allInterfaces) { 973 public IntersectionClassType(List<Type> bounds, ClassSymbol csym, boolean allInterfaces) {
981 super(Type.noType, List.<Type>nil(), csym); 974 super(Type.noType, List.<Type>nil(), csym);
982 this.allInterfaces = allInterfaces; 975 this.allInterfaces = allInterfaces;
983 Assert.check((csym.flags() & COMPOUND) != 0); 976 Assert.check((csym.flags() & COMPOUND) != 0);
984 supertype_field = bounds.head; 977 supertype_field = bounds.head;
1006 return TypeKind.INTERSECTION; 999 return TypeKind.INTERSECTION;
1007 } 1000 }
1008 1001
1009 @Override 1002 @Override
1010 public <R, P> R accept(TypeVisitor<R, P> v, P p) { 1003 public <R, P> R accept(TypeVisitor<R, P> v, P p) {
1011 return intersectionKind == IntersectionKind.EXPLICIT ? 1004 return v.visitIntersection(this, p);
1012 v.visitIntersection(this, p) :
1013 v.visitDeclared(this, p);
1014 } 1005 }
1015 } 1006 }
1016 1007
1017 public static class ArrayType extends Type 1008 public static class ArrayType extends Type
1018 implements javax.lang.model.type.ArrayType { 1009 implements javax.lang.model.type.ArrayType {

mercurial