-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TResult Fallback is incorrectly null [when non-generic Fallback policy is used with generic Execute<TResult> overloads] #294
Comments
Hi. Declaring the policy explicitly as That this is not jumping out as a problem is in part caused by the fact that the compiler will silently accept assigning a Instead, you need to declare that the policy is explicitly for delegates returning
|
@jonnovaretti Thanks for raising this. Did the suggestion fix for you? I think we should fix this in Polly so that it's not possible to fall into the situation you encountered. The combination is: (1) A plain (non-generic) As a result, I think we should treat |
Marking 'up-for-grabs'. Needed:
|
Fixed in Polly v5.6.0 (will be released via nuget in next day or so). Now throws an exception as warning, when non-generic
|
I'm creating a PolicyWrap with CircuitBreak and Fallback. When all occurs right, PolicyResult returns with my result, but when ocurrs a exception and the Fallback executes the PolicyResult bring result null or default value. I created a little test just with Fallback and the result is the same.
What did I do wrong?
The text was updated successfully, but these errors were encountered: