@Override
    public boolean equals(Object other) {
        if (typeStack.contains(this, other)) {
            return true;
        } else if (other instanceof DictType) {
            typeStack.push(this, other);
            DictType co = (DictType) other;
            boolean ret = (co.keyType.equals(keyType) &&
                    co.valueType.equals(valueType));
            typeStack.pop(this, other);
            return ret;
        } else {
            return false;
        }
    }