CA1849 #1107
Unanswered
glen-nicol
asked this question in
Q&A
CA1849
#1107
Replies: 1 comment 5 replies
-
|
Would doing something like remedy your warning? var suffix = number.Match(Some: x => x.ToString(), None: () => string.Empty);I couldn't reproduce it in my local environment to prompt that error, so figure I would throw this out there. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any guidance on how to elegantly avoid the CA1849 warning that occurs in any async method that uses any of the IfNone/Some/Left/Right etc functions that have Async extensions? In my case, my option doesn't require an async context to complete the IfNone result so I don't really want to pay the extra cost of allocating a task. But I also don't want to have to disable that warning globally or everywhere I use these functions with pragmas or a ton of attributes.
Full warning text:
EDIT: changed option type to highlight I only need IfNone(). Original example required a map of int to string.
Beta Was this translation helpful? Give feedback.
All reactions