Files
sdk/pkg/_fe_analyzer_shared/test
Paul Berry b64c9ee5e9 Mini_types: Improve toString logic.
The `toString` logic in `mini_types.dart` is improved in the following ways:

- The `toString` representation of the "unknown" type is changed from
  `?` to `_`, to match the behavior of the mini_types parser.

- Logic for applying parentheses is simplified and moved into the
  function `_parenthesizeIf`.

- The boolean `allowSuffixes` (which was not well documented, and
  poorly named) is replaced with a boolean `parenthesizeIfComplex`,
  and documentation is added to clarify its behavior.

- Unit tests of `toString` are added to `mini_types_test.dart`.

Change-Id: I251e137369b5880017022be2514f00975a511e72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-05-08 20:38:30 +00:00
..