Open inethui opened 6 months ago
You are right, the comparer is not stored. Unless the comparer is serializable too, it's even impossible to implement. If the deserialization creates a new instance of the sorted dictionary, it doesn't know which comparer to use.
I noticed that when a SortedDictionary is serialized/deserialized, its keys are sorted by the natural order of the key's type. The "Comparer" assigned to the SortedDictionary is lost.