package minijava; public class TypeInstance { TypeEnum type; public TypeInstance(TypeEnum type) { this.type = type; } public boolean equal_type(TypeInstance other) { /** * Given a TypeInstance object other, * returns true if other object * is the same type as this one. * * We can say two types are equal, as * long as they are not equal on a * type error! */ return this.type != TypeEnum.ERROR && this.type == other.type; } public TypeEnum get_type() { return this.type; } }