-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent GetRuntimeProperties() Behavior #28056
Comments
Members on types generated by the C# compiler are marked Would your expectation be different if the property was virtual? public class Test : TestBase
{
public override string Value { get; }
}
public class TestBase
{
public virtual string Value { get; }
} |
My expectation is that it behaves the same way methods do. Right now it's very difficult to get all actual available properties on a type due to this "hiding", which isn't an issue with methods. |
Methods also have |
It does appear to be a bug - according to the doc inherited members should be included, and in this case these are two independent (non-virtual) methods so both should be returned. We need to get approval for changing this as it could be classified as a "breaking change". |
Moving to future based on schedule + priority. |
This bug been there since dotnet .NET Framework 1.0 so fixing this now could be quite breaking, as it is quite edge case scenario does not feel it is worth fixing. @mikernet how important the fix for you? What is the scenario where you need this hidden parent property? |
This issue has been marked |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
In the following example:
If you call
typeof(Test).GetRuntimeProperties()
it only returns 1 property. If you change the property type in theTest
class to something else (i.e.int
) then it returns 2 properties. That behavior clearly doesn't make sense - I believe it should be returning both properties in both situations.The text was updated successfully, but these errors were encountered: