check method

  1. @override
void check(
  1. DcqRegistry registry
)

Implementation

@override
void check(
  DcqRegistry registry,
) {
  registry.addTryStatement((node) {
    final catchClauses = node.catchClauses;
    if (catchClauses.length < 2) return;

    final seen = <String>{};
    for (final clause in catchClauses) {
      final body = clause.body.toSource();
      if (!seen.add(body)) {
        reportAtNode(clause);
      }
    }
  });
}