PSScriptAnalyzer icon indicating copy to clipboard operation
PSScriptAnalyzer copied to clipboard

Heads up: (compatibility) rule for dictionary keys IList interface

Open iRon7 opened this issue 4 years ago • 3 comments

Just a heads up: In the (near?) future, dictionary keys are going to support the IList interface. This would mean that e.g. @($Dictionary.Keys)[0] can be simplified to $Dictionary.Keys[0]. see: #15843 Ordered Dictionary keys are not numerically indexable and linked .Net issue: #56835 OrderedDictionaryKeyValueCollection implement IList This might lead to (downwards) compatibility issues, therefore a (compatibility) rule for this (future) enhancement could make sense.

iRon7 avatar Jan 07 '22 20:01 iRon7

Thanks for calling this out @iRon7, just as an FYI, we are not building on the compatability rules at the moment but may in the future!

StevenBucher98 avatar Jan 18 '22 23:01 StevenBucher98

Understood. I was also under the impression that it was about to be implemented for multiple collection keys but the initial request implementation appearently only covered the ordered keys, therefore I have created a new request: #63537 Implement IList interface for all collection keys. Anyways, it will probably take longer than I originally expected before this is being released. I am fine if you like close this case, I am sure that I will remember to reopen it.

iRon7 avatar Jan 19 '22 15:01 iRon7