Closed
Conversation
jsuarezruiz
reviewed
Feb 12, 2024
stephen-hawley
suggested changes
Mar 27, 2024
Contributor
|
In finishing up this PR, I found that there were 3 cases that I ran into:
|
a64b6b9 to
13f106e
Compare
Member
Author
|
/rebase |
13f106e to
54538b1
Compare
Contributor
|
/rebase |
This should take care of all the remaining CA1416 errors. Here's what I found about the analyzer for this - * It understands when code from Xamarin/macios is reachable from maui code and will flag an error * It never understands the pattern `if (!OperatingSystem.IsZZZZZZVersionAtLeast(major, minor)) return;` that implies that the rest of the code in the method is safe, flagging a false failure * Compound OS tests or complex code inside the test will flag a false failure * In the case of [this code](https://gist.github.com/stephen-hawley/716761d318fbcddd7795ed53d331cdc8), the analyzer appears to hang, although to be clear, I don't have evidence that it is the analyzer doing this In order to work around this, the simplest way is to refactor all the OS version specific code into its own method and flag it with `[SupportedOSPlatform("xxxyy.zz")]`. In this case, the above false failures go away. In rare cases, I was unable to do this and instead used a `#pragma` to suppress the warning around the code that triggered the false failure. I tried to avoid this at all costs since this is source of bugs waiting to happen.
stephen-hawley
previously approved these changes
Jun 24, 2024
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
Author
|
Closing in favor of #26593 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Issues Fixed
Fixes #