I have the following method which is covered by passing unit tests;
public static bool TryGetInstance<T>(out T config) where T : class
{
return Instance.TryGetInstance(out config);
}
When I convert this to expression body syntax the unit tests fail?
public static bool TryGetInstance<T>(out T config) where T : class =>
Instance.TryGetInstance(out config);
The failing tests are asserting that the method returns true and that the instance returned for config is not null. I had presumed that these compiled to exactly the same IL?
Why might this be happening?