Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortedList indexer implementation of IDictionary throws ArgumentNullException in Desktop #18394

Closed
Priya91 opened this issue Sep 1, 2016 · 5 comments
Labels
area-System.Collections bug help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@Priya91
Copy link
Contributor

Priya91 commented Sep 1, 2016

SortedList<TKey,TValue>, IDictionary.this[object key] throws ArgumentException when the key is not compatible with TKey

On Desktop ArgumentNullException is thrown. ArgumentNullException is incorrect, as key is not null, ArgumentException is more suited. This is a behavior change, filing issue to track on what we want to do with these differences.

cc @terrajobst @weshaggard @stephentoub @danmosemsft

@Priya91 Priya91 assigned Priya91 and unassigned Priya91 Sep 1, 2016
@karelz karelz changed the title SortedList indexer implementation of Idictionary throws ArgumentNullException in Desktop SortedList indexer implementation of IDictionary throws ArgumentNullException in Desktop Sep 23, 2016
@weshaggard
Copy link
Member

This doesn't really add enough value to really warrant the change from desktop so I we should just make .NET Core behave the same as .NET Framework.

@Priya91
Copy link
Contributor Author

Priya91 commented Oct 13, 2016

.NET Core Collections need to be cleaned up to throw ArgumentNullException in the specified cases in the issue description.

@Priya91 Priya91 removed their assignment Oct 13, 2016
@robosek
Copy link
Contributor

robosek commented Oct 18, 2016

So when key is incompatible .NET Core Collections should throw ArgumentNullException instead of ArgumentException just like it is on Desktop ?

@Priya91
Copy link
Contributor Author

Priya91 commented Oct 18, 2016

So when key is incompatible .NET Core Collections should throw ArgumentNullException instead of ArgumentException just like it is on Desktop ?

Yes, I don't think it's all of the collections, only generic SortedList IDictionary indexer implementation.

@karelz
Copy link
Member

karelz commented Nov 3, 2016

Fixed by above dotnet/corefx#12803

@karelz karelz closed this as completed Nov 3, 2016
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Collections bug help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests

5 participants