Is there an error in Drupal with hook_views_post_execute? In D8 I would like to sum a field in a view within a custom module called nvgh.
I choose to use a hook for a start. I'm not sure this will be the good hook anyway.

https://api.drupal.org/api/drupal/core%21modules%21views%21views.api.php/function/hook_views_post_execute/8.6.x

function nvgh_views_post_execute(ViewExecutable $view) {

  if ($view-&gt;total_rows &gt; 12) {
    \Drupal::messenger()
      -&gt;addStatus(t('You have more than 100 hits. Use the filter settings to narrow down your list.'));
  }
}


I directly get an error:


  The website encountered an unexpected error. Please try again later.
  TypeError: Argument 1 passed to nvgh_views_post_execute() must be an
  instance of ViewExecutable, instance of Drupal\views\ViewExecutable
  given in nvgh_views_post_execute() (line 96 of
  modules\custom\nvgh\nvgh.module).



a) Is this a bug in Drupal 8? 
b) Which hook is common to use for pseudo code like

for each row in view result 


count a field 
display a message
You have to define the statement of ViewExecutable like use \Drupal\views\ViewExecutable

use \Drupal\views\ViewExecutable;

function nvgh_views_post_execute(ViewExecutable $view) {
  if ($view-&gt;total_rows &gt; 12) {
    \Drupal::messenger()
      -&gt;addStatus(t('You have more than 100 hits. Use the filter settings to narrow down your list.'));
  }
}