Add PlainAndColorizedString.toString.

This prevents unsupported error text from being lost when the
unsupported error text is in the form of a PlainAndColorizedString.

Change-Id: Ibc15a6cd17fea085332a308b58356b8d903a3202
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189901
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry
2021-03-10 15:31:23 +00:00
committed by commit-bot@chromium.org
parent c509ad1e41
commit 0fa2fde5aa
@@ -166,7 +166,14 @@ class PlainAndColorizedString {
final String plain;
final String colorized;
@override
String toString() {
assert(false, "Called PlainAndColorizedString.toString: $plain");
return 'PlainAndColorizedString:$plain';
}
const PlainAndColorizedString(this.plain, this.colorized);
const PlainAndColorizedString.plainOnly(this.plain) : this.colorized = plain;
}