Compare commits

..
Author SHA1 Message Date
eb20fb8077
fixup! fix: make SemanticVersionRange equality structural
Some checks failed
default / dotnet-default-workflow (push) Failing after 45s
2026-07-11 23:08:45 +02:00
fba1476d9c feat: support SemanticVersion and SemanticVersionRange as JSON dictionary keys
Some checks failed
default / dotnet-default-workflow (push) Failing after 1m53s
System.Text.Json requires custom converters to override
ReadAsPropertyName/WriteAsPropertyName in order to serialize
types used as dictionary keys. Add those overrides to both
converters so SemanticVersion and SemanticVersionRange can round
trip as Dictionary<TKey,TValue> keys.

Add failing-then-passing tests for both key types.
2026-07-11 23:03:12 +02:00
f9531fe112 fix: make SemanticVersionRange equality structural
The type was a record struct whose ==/Equals/GetHashCode were
synthesized from all fields, including the _sets array, so two
ranges that parse to the same constraint sets compared as
unequal (reference-sensitive on the array). This also broke
using ranges as dictionary keys, where lookup relies on value
equality.

Change the type to a plain readonly struct implementing
IEquatable<SemanticVersionRange> with structural equality over
the constraint sets (operation + version per comparator). The
custom ToString already existed, so no display behaviour is lost.

Add a failing-then-passing test.
2026-07-11 23:03:04 +02:00

Diff content is not available