Version Used:
VS2019 15.9.10
Steps to Reproduce:
- Create the following line of code:
static long? TestParse(string val) => long.TryParse(val, out var parseResult) ? (long?)parseResult : default;
Expected Behavior:
There should not be a suggestion to remove the (long?) cast. Removing the cast will change the result type of the conditional expression to "long" instead of "long?".
Actual Behavior:
"Remove unnecessary cast" is suggested.
Might be the same issue as #29726
Version Used:
VS2019 15.9.10
Steps to Reproduce:
Expected Behavior:
There should not be a suggestion to remove the (long?) cast. Removing the cast will change the result type of the conditional expression to "long" instead of "long?".
Actual Behavior:
"Remove unnecessary cast" is suggested.
Might be the same issue as #29726