code: private void registerMismatchAndReport(
        Node n,
        DiagnosticType diagnostic,
        String msg,
        JSType found,
        JSType required,
        Set<String> missing,
        Set<String> mismatch) {
      String foundRequiredFormatted = formatFoundRequired(msg, found, required, missing, mismatch);
      JSError err = JSError.make(n, diagnostic, foundRequiredFormatted);
      registerMismatch(found, required, err);
      report(err);
    }
docs: Used both for TYPE_MISMATCH_WARNING and INVALID_OPERAND_TYPE.