Closed DoctorKrolic closed 11 months ago
Could you explain why is this needed?
When I did this I was certain that even on modern .NETs there will be System.Collections.Immutable.dll
in the final output since version required by the library and the one included in the framework are too different (1.5.0 vs 8.0.0 on .NET 8, which is many major versions difference). Thus the main goal of the PR was to conditionally exclude System.Collections.Immutable
from the dependency list and unlock other potential updates like this in the future (e.g. replace self-made hashcode combiner with now built-in HashCode
struct by conditionally referencing Microsoft.Bcl.HashCode
on .NET Standard and using a built-in solution on .NET 6+). You question made me question my certainty and actually check it. As it turned out, my initial assumption is actually not correct making this PR irrelevant. So I'll close it. Will extract changes related to warnings into a separate PR
I feel like those are all valid points, but we could solve them one by one. For example for Hashcodes I like value tuples, e.g. (A, B, C).GetHashCode(). We could bump Immutable to latest, or maybe copy paste a couple types and delete the dependency altogether. I think our usage of Immutable is very modest.
Yes, the only thing we use Immutable for is ImmutableArray:
I'd be happy to either switch to a regular .NET array or collection (like IReadOnlyList) or copy-paste the ImmutableArray source (doesn't seem worth it) or bump the old 1.2.3.0 version to anything more modern such as 6.0.0.
I don't see a lot of value in using ImmutableArray
MS.Language.Xml
multitarget .NET Standard 2.0 and all currently supported .NETsSystem.Collection.Immutable
reference to the latest version and scoped it tonetstandard2.0
since it is included to the standard library for modern .NETs by defaultMS.Language.Xml
and made it run .NET tests (this includes addingMicrosoft.NET.Test.Sdk
package reference since .NET test cannot be run without it)xunit
versions to the latest available