docs: private void addTypeSubstitutions(Map<Wrapper<ExprNode>, SoyType> substitutionsToAdd) {
      for (Map.Entry<Wrapper<ExprNode>, SoyType> entry : substitutionsToAdd.entrySet()) {
        ExprNode expr = entry.getKey().get();
        // Get the existing type
        SoyType previousType = expr.getType();
        for (TypeSubstitution subst = substitutions; subst != null; subst = subst.parent) {
          if (ExprEquivalence.get().equivalent(subst.expression, expr)) {
            previousType = subst.type;
            break;
          }
        }
  
        // If the new type is different than the current type, then add a new type substitution.
        if (!entry.getValue().equals(previousType)) {
          substitutions = new TypeSubstitution(substitutions, expr, entry.getValue());
        }
      }
    }