Looking through the source code of the .NET kernel for System.Linq.Expressions, I found the following code located here :
MethodInfo mi = property.GetGetMethod(true);
if (mi == null)
{
mi = property.GetSetMethod(true);
if (mi == null)
{
throw Error.PropertyDoesNotHaveAccessor(property, nameof(property));
}
}
Is there any way that GetGetMethod u GetSetMethod can return null, as it seems, is taken into account here? Is this dead code? The C # compiler does not allow the property to have no getter and no setter, as this is possible for PropertyInfo.
My motivation is to contribute to the OSS code by adding test coverage, so I'm trying to figure out which test cases this will cover
source
share