You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
In Java, Map.get returns null when an element does not exist. In C#, the get indexer for IDictionary<TKey, TValue> throws an exception in the same scenario. Currently calls to get are getting translated into indexer usage, but this breaks the semantics for this operation. The correct code for this case would be the following:
Java:
Tvalue = map.get(key);
C#:
Tvalue;map.TryGetValue(key,outvalue);
The text was updated successfully, but these errors were encountered:
In Java,
Map.get
returnsnull
when an element does not exist. In C#, the get indexer forIDictionary<TKey, TValue>
throws an exception in the same scenario. Currently calls toget
are getting translated into indexer usage, but this breaks the semantics for this operation. The correct code for this case would be the following:Java:
C#:
The text was updated successfully, but these errors were encountered: