replace runtimeType.toString()#48892
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
I made a lint available in https://github.com/a14n/linter/tree/avoid_runtimeType_toString that find some other places but I'm not sure if it make sense to replace them. WDYT? |
There was a problem hiding this comment.
This one is ok because it's part of an assertion.
Is there some way to make the lint recognize whether the call is within an assert or throw?
There was a problem hiding this comment.
The lint does test if it's inside an assertion. I don't see assert in this case.
There was a problem hiding this comment.
Ah yes, I was imprecise. It should still be ok if it's part of a throw. At that point, we don't really care about performance as much anymore and having the real type information would be helpful.
There was a problem hiding this comment.
I reverted this change.
663aa95 to
ab2337f
Compare
Description
follow up on #48607
Related Issues
#31695
Tests
None
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.