code: private void checkDestructuringAssignment(
        NodeTraversal t, Node nodeToWarn, Node pattern, JSType rightType, String msg) {
      for (DestructuredTarget target :
          DestructuredTarget.createAllNonEmptyTargetsInPattern(typeRegistry, rightType, pattern)) {
  
        // TODO(b/77597706): this is not very efficient because it re-infers the types below,
        // which we already did once in TypeInference. don't repeat the work.
        checkCanAssignToWithScope(
            t, nodeToWarn, target.getNode(), target.inferType(), /* info= */ null, msg);
      }
    }
docs: Recursively checks that an assignment to a destructuring pattern is valid for all the lvalues
  contained in the pattern (including in nested patterns).