StephenCleary / Comparers

The last comparison library you'll ever need!
MIT License
427 stars 33 forks source link

Change example code for DefaultComparer #32

Closed m-ringler closed 3 years ago

m-ringler commented 3 years ago

In the example code for EquatableBase<T> declare a DefaultComparer property in the derived type to make sure that the static constructor has run. This will prevent users from getting null when using DerivedType.DefaultComparer (as I have repeatedly).

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 99.577% when pulling 62e1a81785dc84df840e4accbce76c61dddb1bc3 on m-ringler:master into e872048723a071aee92151528c6c8cde072fcc30 on StephenCleary:master.

StephenCleary commented 3 years ago

Thank you for your bug report! I've created some unit tests to repro it and was able to fix it without requiring awkward code in the derived type.

This will be fixed in version 6.1.0. If you would like the fix now, you can upgrade to version 6.1.0-pre03 which should be published shortly.

m-ringler commented 3 years ago

That really is much better. Thanks for the fix (and a very useful library).