-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[analyzer] NodeReplacer throws when replacing the block of a catch clause #47726
Comments
Glad you found a workaround. A PR would be much appreciated. |
So I put together a test case, ran it, and oddly, it didn't fail. Turns out some code was added somewhat recently that invalidates the testing approach — the first if statement in this snippet: (line 3012–3014) sdk/pkg/analyzer/lib/src/dart/ast/utilities.dart Lines 3011 to 3022 in cb33212
The BUT, on the upside, I commented out the early exit and tests are all passing (except for the one I added, yay!),. Fixing this is a bit beyond the scope of what I'm wanting to do. Would you like me to send a PR for my catch body change, along with a test that will work when this other issue is resolved? |
So...still send the PR? I can at least fix one of the bugs. |
I will fix it, there is some work to be done in better testing. |
sg. Thanks. |
Bug: #47726 Change-Id: I6eb301df8b1452660f06963008f9de861ea745d9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220806 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Hi there,
I found a small issue in the implementation of
NodeReplacer.visitCatchClause
, which prevents catch cause replacement.sdk/pkg/analyzer/lib/src/dart/ast/utilities.dart
Lines 1728 to 1740 in cb33212
You'll notice that there is no handling for the catch's body block, and as a result the code hits
visitNode
, andvisitNode
throws.It's an easy fix. Happy to send a PR your way. For now I've gotten around it with a subclass.
Thanks!
The text was updated successfully, but these errors were encountered: