Skip to content

Commit e8ff9ef

Browse files
stereotype441Commit Queue
authored andcommitted
Add _PropertyElement.toString.
This improves the debug experience when debugging flow analysis code. Change-Id: I876dece6213b0495caae5a9e673376898198e709 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389221 Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Kallen Tu <[email protected]>
1 parent 867391e commit e8ff9ef

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/_fe_analyzer_shared/test/mini_ast.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ class Harness {
16821682

16831683
late final Map<String, _PropertyElement?> _members = {
16841684
for (var entry in _coreMemberTypes.entries)
1685-
entry.key: _PropertyElement(entry.value,
1685+
entry.key: _PropertyElement(entry.value, entry.key.split('.').last,
16861686
isPromotable: false, whyNotPromotable: null)
16871687
};
16881688

@@ -1769,7 +1769,7 @@ class Harness {
17691769
_members[query] = null;
17701770
return;
17711771
}
1772-
_members[query] = _PropertyElement(Type(type),
1772+
_members[query] = _PropertyElement(Type(type), memberName,
17731773
isPromotable: promotable, whyNotPromotable: whyNotPromotable);
17741774
}
17751775

@@ -6209,6 +6209,12 @@ class _PropertyElement {
62096209
/// The type of the property.
62106210
final Type _type;
62116211

6212+
/// The name of the property (used by toString)
6213+
final String _name;
6214+
6215+
@override
6216+
String toString() => '$_type.$_name';
6217+
62126218
/// Whether the property is promotable.
62136219
final bool isPromotable;
62146220

@@ -6223,7 +6229,7 @@ class _PropertyElement {
62236229
/// to the test.
62246230
final PropertyNonPromotabilityReason? whyNotPromotable;
62256231

6226-
_PropertyElement(this._type,
6232+
_PropertyElement(this._type, this._name,
62276233
{required this.isPromotable, required this.whyNotPromotable}) {
62286234
if (isPromotable) {
62296235
assert(whyNotPromotable == null);

0 commit comments

Comments
 (0)