Skip to content
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

CA1416 Fix Version comparison ambiguity #5079

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Apr 29, 2021

Related Issues: #4932
Port of #4943

The comparison of versions having leading 0 causing CA1416 malfunction

Context:

The comparison operations of the Version type is a bit strange:

Console.WriteLine(Version.Parse("10.0.17763.0") < Version.Parse("10.0.17763")); // False
Console.WriteLine(Version.Parse("10.0.17763.0") > Version.Parse("10.0.17763")); // True
Console.WriteLine(Version.Parse("10.0.17763.0") == Version.Parse("10.0.17763")); // False

The WinRT team wants the fix serviced in 5.0

Risk:

No risk of causing new warnings instead suppresses warnings caused from leading 0 like above.

CC @jeffhandley @jmarolf @marcpopMSFT @mavasani

@buyaa-n buyaa-n requested a review from a team as a code owner April 29, 2021 21:55
@buyaa-n buyaa-n changed the title Merge conflicts CA1416 Fix Version comparison ambiguity Apr 29, 2021
Copy link
Contributor

@jmarolf jmarolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #5079 (f3a6a19) into release/5.0.3xx (755ceda) will decrease coverage by 0.00%.
The diff coverage is 92.75%.

@@                 Coverage Diff                 @@
##           release/5.0.3xx    #5079      +/-   ##
===================================================
- Coverage            95.82%   95.82%   -0.01%     
===================================================
  Files                 1164     1165       +1     
  Lines               264739   264851     +112     
  Branches             15993    16005      +12     
===================================================
+ Hits                253698   253792      +94     
- Misses                9022     9027       +5     
- Partials              2019     2032      +13     

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been approved for 5.0.3xx GA.

@buyaa-n buyaa-n merged commit 88a0bae into dotnet:release/5.0.3xx Apr 29, 2021
@buyaa-n buyaa-n deleted the port_version_fix branch April 29, 2021 23:32
buyaa-n added a commit that referenced this pull request May 11, 2021
* Add localization from OneLocBuild (2021-04-27)

* Merge conflicts (#5079)

* Add localization from OneLocBuild (2021-04-28)

Co-authored-by: Jon Fortescue <jonfortescue@protonmail.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
Co-authored-by: Jonathon Marolf <jmarolf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants