package chocopy.common.analysis.types; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** * Representation for the static type of symbols and expressions during type-checking. * *
Symbols such as variables and attributes will typically map to a {@link ValueType}. * *
Symbols such as classes will typically map to a more complex Type.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonSubTypes({
@JsonSubTypes.Type(FuncType.class),
@JsonSubTypes.Type(ClassValueType.class),
@JsonSubTypes.Type(ListValueType.class)
})
public abstract class Type {
/** The type object. */
public static final ClassValueType OBJECT_TYPE = new ClassValueType("object");
/** The type int. */
public static final ClassValueType INT_TYPE = new ClassValueType("int");
/** The type str. */
public static final ClassValueType STR_TYPE = new ClassValueType("str");
/** The type bool. */
public static final ClassValueType BOOL_TYPE = new ClassValueType("bool");
/** The type of None. */
public static final ClassValueType NONE_TYPE = new ClassValueType("