Repository navigation
Display parents' members on GetProperties. - #68907
Conversation
|
All tests that failed in staging failed due to timeout and locally when run separately, are passing. |
|
Could you please add the description of the what is being solved here in the PR description itself? |
|
I would also suggest changing: public class BaseBaseClass
{
private string _memberForOverrideBackingField = "BaseBaseClass#BaseBase_MemberForOverride";
public string BaseBase_MemberForOverride
{
get { return _memberForOverrideBackingField; }
set { _memberForOverrideBackingField = value; }
}
}.. so we can check calling getters on such base members. |
…rrectly and should be fixed.
|
There is a failing test right now. I'll continue the review once that is fixed. This might be useful to add btw: diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
index 4647fa8f998..78e8030d2a9 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
@@ -732,7 +732,20 @@ internal async Task CheckProps(JToken actual, object exp_o, string label, int nu
if (!skip_num_fields_check)
{
num_fields = num_fields < 0 ? exp.Values<JToken>().Count() : num_fields;
- Assert.True(num_fields == actual.Count(), $"[{label}] Number of fields don't match, Expected: {num_fields}, Actual: {actual.Count()}");
+ var expected_str = string.Join(", ",
+ exp.Children()
+ .Select(e => e is JProperty jprop ? jprop.Name : e["name"]?.Value<string>())
+ .Where(e => !string.IsNullOrEmpty(e))
+ .OrderBy(e => e));
+
+ var actual_str = string.Join(", ",
+ actual.Children()
+ .Select(e => e["name"]?.Value<string>())
+ .Where(e => !string.IsNullOrEmpty(e))
+ .OrderBy(e => e));
+ Assert.True(num_fields == actual.Count(), $"[{label}] Number of fields don't match, Expected: {num_fields}, Actual: {actual.Count()}.{Environment.NewLine}"
+ + $" Expected: {expected_str}{Environment.NewLine}"
+ + $" Actual: {actual_str}");
}
foreach (var kvp in exp) |
068f19c to
d7226a3
Compare
|
/azp run runtime-staging |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
I had a hard time trying to figure out why the various changes were needed, and I ended up reworking that code a bit to make it easier to read (IMHO!). https://gist.github.com/radical/294a89671bc1412468a071e7624cd685 |
radical
left a comment
There was a problem hiding this comment.
Make sure the tests are passing after the last two changes. Other than that, looks great 👍
Fixes #68542.
In Console Application class

DerivedClassfrom testInspectTypeInheritedMembersdisplays more members ongetPropertiesthan the same class in a Blazor project. The missing members belong to parents ofDerivedClassand have the same names as the ones inDerivedClass. The desired behavior is on the screenshot below:Changes:
getPropertiesresponse unique, we append parent class's name in brackets to the original name. If the parent's member is shadowed and no duplicated names are present, we do not change the name.BaseBaseClass + BaseClass test hiding 3 types of members: fields, properties and auto-properties.
BaseClass + DerivedClass test overriding of properties and auto-properties.
BaseClass has 2 virtual properties that have the same attributes as new-hidden members and have to be displayed while virtual members have to be skipped.
DebuggerTests.MiscTests.InspectTaskAtLocals, now not-ownDebuggerDisplayMethodDescription (Task)is also returned on GetProperties. Before it was skipped in the test even though it's visible in ConsoleApp: