anchor.diff:          types.add(str.substring(p, i));
           p = i = i + 2;
         }
  +      if (str[i] == '[') {
  +        hasOptionalArguments = true;
  +        types = optionalParameterTypes;
  +        p = i + 1;
  +      }
  +      if (str[i] == ']') {
  +        types.add(str.substring(p, i));
  +        break;
  +      }
       }
  -    if (str.length > 0) {
  -      types.add(str.substring(p, str.length));
  +    if (str.length > 0 && types == positionalParameterTypes) {
  +      positionalParameterTypes.add(str.substring(p, str.length));
       }
  -    var n = types.length;
  +    _replaceGenericsArguments(genericsArguments, positionalParameterTypes);
  +    _replaceGenericsArguments(genericsArguments, optionalParameterTypes);
  +  }
  +
  +  void _replaceGenericsArguments(
  +      List<String> genericsArguments, List<String> types) {
       genericsArguments?.forEach((a) {
  +      var n = types.length;
         for (var i = 0; i < n; i++) {
           if (a == types[i]) {
             types[i] = 'dynamic';
  
positive.code:         }
        }
      });
      positionalParameterTypes = types;
    }
  }
  
negative.code:     str = str.substring(p + 2, str.indexOf(') => '));
      p = str.indexOf('{');
      if (p != -1) {
        hasNamedArguments = true;
        _parseNamedParameters(
            genericsArguments, str.substring(p + 1, str.length - 1));
        str = str.substring(0, p - 2);
      }
      int nesting = 0;
      p = 0;
      var types = positionalParameterTypes;
      for (var i = 0; i < str.length; i++) {
        if (str[i] == '<') nesting++;
        if (str[i] == '>') nesting--;
  