toString method

  1. @override
String toString ()
override

Returns a string representation of this object.

Implementation

@override
String toString() {
  StringBuffer buf = new StringBuffer();
  buf.write('No matching invocation found: ');
  buf.write(getSymbolName(invocation.memberName));
  if (invocation.isMethod) {
    buf.write('(');
    int i = 0;
    for (dynamic arg in invocation.positionalArguments) {
      buf.write(Error.safeToString(encode(arg)));
      if (i++ > 0) {
        buf.write(', ');
      }
    }
    invocation.namedArguments.forEach((Symbol name, dynamic value) {
      if (i++ > 0) {
        buf.write(', ');
      }
      buf.write('${getSymbolName(name)}: ${encode(value)}');
    });
    buf.write(')');
  } else if (invocation.isSetter) {
    buf.write(Error.safeToString(encode(invocation.positionalArguments[0])));
  }
  return buf.toString();
}