Skip to content

Commit 2c38c8b

Browse files
stereotype441Commit Queue
authored andcommitted
[front_end] Change TypeLabeler to return LabeledString.
The methods 'TypeLabeler.labelConstant` and `TypeLabeler.labelType` are changed so that instead of returning a list of `Object` (which the caller needs to `join()`), they return a new `LabeledString` class whose `toString()` method takes care of calling `join()`. This simplifies the code generation of CFE diagnostic `.withArgumentsOld` methods, because it's no longer necessary to be careful about calling `join()` after *all* inputs have been converted; instead, the inputs can be converted in whatever order is convenient, and the final `join()` happens implicitly when the `LabeledString`s are converted to `String`s as part of string interpolation. In follow-up CLs, I plan to rework the code generator for `withArgumentsOld` so that it's easy to generate a parallel `withArguments` function that takes named arguments. Starting from a less complex code generator will make that rework easier. Change-Id: I6a6a696415b214b7743f8e23192f2320aa499987 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447821 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 4e9b0cd commit 2c38c8b

File tree

4 files changed

+215
-381
lines changed

4 files changed

+215
-381
lines changed

0 commit comments

Comments
 (0)