Skip to content

Fix version comparison #618

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

Merged
merged 2 commits into from
Oct 5, 2023
Merged

Fix version comparison #618

merged 2 commits into from
Oct 5, 2023

Conversation

tristanlabelle
Copy link
Contributor

Typescript does not support operator overloading. What was happening when we compared two Version objects was that toString was called on both sides and the strings were compared. Unfortunately the unit test wasn't catching this because the strings ended up being lexicographically ordered.

This probably fixes several issues, but the one I was after is the Windows xctest path in the debug configuration being incorrect with a Swift 5.11 build because the >= new Version(5, 7, 0) was returning false.

Copy link
Contributor

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

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

Whoops that slightly embarrassing. Changes look good

@adam-fowler adam-fowler merged commit 06d776c into swiftlang:main Oct 5, 2023
@tristanlabelle tristanlabelle deleted the tristan/fix-version-comparison branch October 5, 2023 22:47
adam-fowler pushed a commit that referenced this pull request Oct 6, 2023
* fix-xctest-version-comparison

* Fix all instances of version comparison
@tristanlabelle
Copy link
Contributor Author

@adam-fowler This PR was merged, but I don't see the changes in main. What happened? 🤔

@adam-fowler
Copy link
Contributor

Err not sure what has happened here. I'll go check what I have locally.

@adam-fowler
Copy link
Contributor

It is on main. Just after 1.5.2 changelog commit.

@tristanlabelle
Copy link
Contributor Author

Hmm never mind then, not sure what happened here. I also verified this works on 1.7.0. Thanks!

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.

2 participants