Skip to content

Commit f0ca55f

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate use_rethrow_when_possible
Bug: https://github.com/dart-lang/linter/issues/5099 Change-Id: Ia3a693d291b261c51268b2d75c84ed8bd2ef2dcc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391521 Commit-Queue: Brian Wilkerson <[email protected]> Auto-Submit: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 4d11d8f commit f0ca55f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/linter/lib/src/rules/use_rethrow_when_possible.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class _Visitor extends SimpleAstVisitor<void> {
3737
void visitThrowExpression(ThrowExpression node) {
3838
if (node.parent is! ExpressionStatement) return;
3939

40-
var element = node.expression.canonicalElement;
40+
var element = node.expression.canonicalElement2;
4141
if (element != null) {
4242
var catchClause = node.thisOrAncestorOfType<CatchClause>();
4343
var exceptionParameter =
44-
catchClause?.exceptionParameter?.declaredElement?.canonicalElement;
44+
catchClause?.exceptionParameter?.declaredElement2;
4545
if (element == exceptionParameter) {
4646
rule.reportLint(node);
4747
}

0 commit comments

Comments
 (0)