Remove unneeded casts
These casts are not needed and can be safely removed
Summary of the Pull Request
Removed casts that did not need to happen because the variable is already the target type.
PR Checklist
- [x] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
- [X] Tests: Added/updated and all pass
- [X] Localization: All end user facing strings can be localized
- [X] Dev docs: Added/updated
- [x] New binaries: Added on the required places
- [x] JSON for signing for new binaries
- [x] WXS for installer for new binaries and localization folder
- [x] YML for CI pipeline for new test projects
- [x] YML for signed pipeline
- [X] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Tests passed
How are these getting determined unneeded. Trying to see why this hasn’t been done yet
Well, for starters, all casts to object are redundant by definition.
Second, static analysis shows that these casts were superfluous
My feedback is your suggestion changes but not helping explain from a PR stance why.
What tool are you running or is this an existing flag in the build output?
not saying this is a bad thing, trying to understand how these got flagged.
Trust me, I’m all about getting analysis tools built into the pipelines.
@crutkas these were Rosyln (the C# compiler) warnings
@AtariDreams This is larger than casting now.
PRs really need to be scoped
Done!
@crutkas Fixed the PR
These changes were from when changes from different PRs got mixed in.
@crutkas fixed!
my main question of how these are getting flagged is still unanswered.
Is this a warning in the build output? A screenshot would be massively helpful for helping us cause right now I do not understand why we are removing the casts
Some were found manually. Others were by Roslyn warnings
@crutkas Also, casts to (object) are redundant, and casts to literals are redundant as well
Once again, I need to understand how we can validate this. We did an aggressive scrub with analyzers a while back and I’m surprised this wasn’t caught as a build warning at a minimum by them
Where are these warnings appear exactly? How can we repro this?
Closing this, as it's not clear why the change is needed. Please re-open if you feel it's still neccessary.