In the documentation for C# the GetProperties method of the Type class returns an array of Property Infos: System.Reflection.PropertyInfo[]. You can see this in the documentation here:
https://learn.microsoft.com/en-us/dotnet/api/system.type.getproperties?view=net-8.0
However, the PropertyInfo class is marked as abstract in the documentation:
https://learn.microsoft.com/en-us/dotnet/api/system.reflection.propertyinfo?view=net-8.0
Wondering how this is possible since abstract classes cannot be instantiated in c#. Would this be a typo in the documentation or is it returning something else?
You're correct that
PropertyInfois abstract. The thing is,GetProperties()actually returnsRuntimePropertyInfo(a child class ofPropertyInfo), which is not abstract. It isinternal sealedso you still can't instantiate it, but the runtime can.