anchor.diff:  
       errorMessages
           .addAll(_checkTypeParameters(function.typeFormals, enclosingElement));
  -    errorMessages
  -        .addAll(_checkTypeArguments(function.typeArguments, enclosingElement));
  +
  +    var aliasArguments = function.aliasArguments;
  +    if (aliasArguments != null) {
  +      errorMessages
  +          .addAll(_checkTypeArguments(aliasArguments, enclosingElement));
  +    }
   
       return errorMessages;
     }
  
positive.code:   /// [InvalidMockitoAnnotationException] under various conditions.
    static analyzer.InterfaceType _determineDartType(
        analyzer.DartType typeToMock, TypeProvider typeProvider) {
      final elementToMock = typeToMock.element;
      if (elementToMock is ClassElement) {
        if (elementToMock.isEnum) {
          throw InvalidMockitoAnnotationException(
              'Mockito cannot mock an enum: ${elementToMock.displayName}');
  
negative.code: 
      for (var parameter in function.parameters) {
        var parameterType = parameter.type;
        if (parameterType is analyzer.InterfaceType) {
          var parameterTypeElement = parameterType.element;
          if (parameterTypeElement?.isPrivate ?? false) {
            // Technically, we can expand the type in the mock to something like
            // `Object?`. However, until there is a decent use case, we will not
  