dotnet / dotNext

Next generation API for .NET
https://dotnet.github.io/dotNext/
MIT License
1.62k stars 121 forks source link

Suggestion: Change ITypeMap.GetIndex<TKey> Accessibility to Protected #161

Closed zacharylayne closed 1 year ago

zacharylayne commented 1 year ago

I'd like to implement ITypeMap<T> but to do so it seems I'd have to reimplement indexing since GetIndex<TKey>() is private protected . Would it be sensible to change GetIndex accessibility to protected?

sakno commented 1 year ago

GetIndex is an implementation detail, and may be changed in future. Indexing space is a sparse space, e.g. GetIndex<string> may return different indexes for different actual TValue. It is impractical to keep backward compatibility for this API. I may decide to change the behavior of this method or remove generic parameter at all.