This method can be used to debug hashing.

We have tried to come up with a more robust way to debug hash, such as to construct the hash tree, but that's not quite feasible for the following reasons:

  1. Since sometimes there are properties we don't drill down like for a class, we just take the path, we don't have a systematic way to construct the hash tree, so we have to rely on the implementation of the hashCode function in each element, which defeats the purpose of having a generic approach for debugging hash
  2. If we ignore the implementation detail of get hashCode and expand the property if it has hashCode then we might risk getting into an infinite loop
  3. The manual way to come up with the get hashCode is in order to reconcile the differences between metamodels and protocol models. If we only compare metamodels to protocol models for example, the problem might be less complicated, but we're dealing with 2 hash systems (in a way)
  4. As such, the best solution at the moment is to come up with a function like this to debug hash where we can put it at a top level structure like Mapping and then choose which part of the hash we would like to explore
  • Parameters

    • obj: Hashable
    • typesToExpand: Clazz<Hashable>[]

      when we trickle down the object properties, we want to drill down so we want to choose the property to drill down (by its type) since sometimes we don't need to compute the actual hash code for the property (for example: a class, or an enumeration) while computing the hash, just their path.

    • depth: number = 0

    Returns string