langtools/src/share/classes/com/sun/tools/javac/code/Type.java
changeset 1257 873b053bf757
parent 1206 3a05355982a9
child 1260 a772ba9ba43d
equal deleted inserted replaced
1209:add7eef3ce4a 1257:873b053bf757
  1192     }
  1192     }
  1193 
  1193 
  1194     public static class ErrorType extends ClassType
  1194     public static class ErrorType extends ClassType
  1195             implements javax.lang.model.type.ErrorType {
  1195             implements javax.lang.model.type.ErrorType {
  1196 
  1196 
  1197         public ErrorType() {
  1197         private Type originalType = null;
       
  1198 
       
  1199         public ErrorType(Type originalType, TypeSymbol tsym) {
  1198             super(noType, List.<Type>nil(), null);
  1200             super(noType, List.<Type>nil(), null);
  1199             tag = ERROR;
  1201             tag = ERROR;
  1200         }
  1202             this.tsym = tsym;
  1201 
  1203             this.originalType = (originalType == null ? noType : originalType);
  1202         public ErrorType(ClassSymbol c) {
  1204         }
  1203             this();
  1205 
  1204             tsym = c;
  1206         public ErrorType(ClassSymbol c, Type originalType) {
       
  1207             this(originalType, c);
  1205             c.type = this;
  1208             c.type = this;
  1206             c.kind = ERR;
  1209             c.kind = ERR;
  1207             c.members_field = new Scope.ErrorScope(c);
  1210             c.members_field = new Scope.ErrorScope(c);
  1208         }
  1211         }
  1209 
  1212 
  1210         public ErrorType(Name name, TypeSymbol container) {
  1213         public ErrorType(Name name, TypeSymbol container, Type originalType) {
  1211             this(new ClassSymbol(PUBLIC|STATIC|ACYCLIC, name, null, container));
  1214             this(new ClassSymbol(PUBLIC|STATIC|ACYCLIC, name, null, container), originalType);
  1212         }
  1215         }
  1213 
  1216 
  1214         @Override
  1217         @Override
  1215         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
  1218         public <R,S> R accept(Type.Visitor<R,S> v, S s) {
  1216             return v.visitErrorType(this, s);
  1219             return v.visitErrorType(this, s);
  1230         public List<Type> allparams()            { return List.nil(); }
  1233         public List<Type> allparams()            { return List.nil(); }
  1231         public List<Type> getTypeArguments()     { return List.nil(); }
  1234         public List<Type> getTypeArguments()     { return List.nil(); }
  1232 
  1235 
  1233         public TypeKind getKind() {
  1236         public TypeKind getKind() {
  1234             return TypeKind.ERROR;
  1237             return TypeKind.ERROR;
       
  1238         }
       
  1239 
       
  1240         public Type getOriginalType() {
       
  1241             return originalType;
  1235         }
  1242         }
  1236 
  1243 
  1237         public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  1244         public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  1238             return v.visitError(this, p);
  1245             return v.visitError(this, p);
  1239         }
  1246         }