blob: 6d6ab870cfb694a2c0e99a0646660ff25ab78761 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// test w/ `dart test -N avoid_catching_errors`
// ignore_for_file: unused_catch_clause
void bad() {
try {} on A catch (e) { // LINT
// ignore
} on B catch (e) { // LINT
// ignore
} on C { // LINT
// ignore
} on D { // LINT
// ignore
} on Error catch (e) { // LINT
// ignore
} on Exception catch (e) { // OK
// ignore
} on String catch (e) { // OK
// ignore
} catch (e) {// OK
// ignore
}
}
class A extends B {}
class B implements Error {
@override
StackTrace? get stackTrace => null;
}
class C extends D {}
class D extends Error {}