question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About ordering (seems that's becoming my speciality :))

See original GitHub issue

Since it is not strictly a bug, I’m opening an issue here. The semver specification explicitly states that:

“Build metadata SHOULD be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85.”

However, the Build metadata is actually considered in CompareTo method:

    public int CompareTo(SemVersion other)
    {
        if (ReferenceEquals(other, null))
            return 1;

        var r = this.CompareByPrecedence(other);
        if (r != 0)
            return r;

        r = CompareComponent(this.Build, other.Build);
        return r;
    }

Up to me, it should only be:

    public int CompareTo(SemVersion other)
    {
        if (ReferenceEquals(other, null))
            return 1;

        return CompareByPrecedence(other);
    }

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
olivier-spinellicommented, Jul 10, 2015

That’s exactly my point: semantically, the Build does not participate at all (It is a “decoration”): I would ignore it in CompareTo as well as in Equal (and document this of course).

0reactions
WalkerCodeRangercommented, May 15, 2022

In v2.2.0, the CompareTo method has been marked [Obsolete]. It has been replaced by a CompareSortOrderTo and ComparePrecedenceTo method so that it will always be clear how the versions are being compared.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How retailers can keep up with consumers
When a customer orders a pair of shoes online at full price, the system looks across the network for the store that has...
Read more >
Check Your Prescription Status
Conveniently check your prescription status online by tracking your order and receiving Rx status text alerts with CVS Specialty pharmacy.
Read more >
14 Different Types of Surgeons and Surgical Specialities
Considering becoming a surgeon? St. George's Medical School reviews 14 types of surgeons and different surgical specialties you could ...
Read more >
Protective Orders | Bexar County, TX - Official Website
Orders that the person you filed against not commit any of the above acts towards you or your household members. Who can you...
Read more >
Pricing and Insurance | DUPIXENT® (dupilumab)
Find information on insurance coverage, ordering through a specialty pharmacy, and the cost of DUPIXENT® (dupilumab), a prescription medicine FDA-approved ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found