use of dyvilx.tools.compiler.ast.type.raw.ClassType in project Dyvil by Dyvil.
the class IType method readType.
static IType readType(DataInput dis) throws IOException {
int tag = dis.readUnsignedByte();
IType type;
switch(tag) {
case UNKNOWN:
return Types.UNKNOWN;
case NULL:
return Types.NULL;
case NONE:
return Types.NONE;
case ANY:
return Types.ANY;
case PRIMITIVE:
return PrimitiveType.fromTypecode(dis.readByte());
case CLASS:
type = new ClassType();
break;
case PACKAGE:
type = new PackageType();
break;
case GENERIC:
type = new ClassGenericType();
break;
case TUPLE:
type = new TupleType();
break;
case LAMBDA:
type = new LambdaType();
break;
case ARRAY:
type = new ArrayType();
break;
case MAP:
type = new MapType();
break;
case OPTIONAL:
type = new NullableType();
break;
case IMPLICIT_OPTIONAL:
type = new ImplicitNullableType();
break;
case REFERENCE:
type = new ReferenceType();
break;
case ANNOTATED:
type = new AnnotatedType();
break;
case TYPE_VAR:
type = new NamedType();
break;
case WILDCARD_TYPE:
type = new WildcardType();
break;
case MISSING_TAG:
return null;
default:
throw new Error("Cannot decode TypeTag " + tag);
}
type.read(dis);
return type;
}
Aggregations