Fix CommentInserter crash on compact classes#4963
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4963 +/- ##
===============================================
+ Coverage 58.657% 58.661% +0.003%
Complexity 2564 2564
===============================================
Files 699 699
Lines 40121 40122 +1
Branches 7314 7315 +1
===============================================
+ Hits 23534 23536 +2
Misses 13620 13620
+ Partials 2967 2966 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@jlerbsc Do you agree with this fix? I can't think of any situations where just skipping nodes without a range is a problem (especially since they just result in a crash later), but there could be cases where this could hide some sort of bug |
All tests are running, including the new ones, so I think the fix is appropriate. |
|
OK great, I'll merge it then |
Fixes #4961.
The crash was caused by the CommentInserter attempting to attribute a comment to a node without a range which is now possible for compact classes (the SimpleName child of the compact class was the specific one causing the crash reported).