getFormattedString method

String getFormattedString()

Implementation

String getFormattedString() {
  switch (kind) {
    case 'array':
      final type = (this as RegistryArrayType);
      return '[${type.item.toString()}; ${type.length}]';
    case 'tuple':
      return '(${(this as RegistryTupleType).params.map((RegistryType t) => t.toString()).join(', ')})';
    case 'named':
      final type = (this as RegistryNamedType);
      if (type.params.isEmpty) {
        return type.name;
      } else {
        return '${type.name}<${type.params.map((t) => t is int ? t.toString() : (t as RegistryType)).join(', ')}>';
      }
  }
  return '';
}