dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
627 stars 172 forks source link

Docs for `avoid_type_to_string` are confusing; what type? #3752

Open srawlins opened 1 year ago

srawlins commented 1 year ago

Describe the issue

The docs say

DO avoid calls to .toString() in production code, since it does not contractually return the user-defined name of the Type (or underlying class).

What type? I think calling .toString() is extremely safe and dependable, especially if I override with my own implementation.

This probably intended to discuss Type.toString().

bwilkerson commented 1 year ago

Correct. The replacement for the docs should definitely make this more clear.

erlangparasu commented 2 months ago

any updates?

srawlins commented 2 months ago

No updates