<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:23 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-290] Ambiguity between overloads with an IDictionary or an IDictionary&lt;string, object&gt; parameter</title>
                <link>https://jira.mongodb.org/browse/CSHARP-290</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;When we introduced new overloads of BsonDocument constructors and methods with a non-generic IDictionary parameter (which we did to be Powershell friendly) we created an ambiguity with other overloads with a generic IDictionary&amp;lt;string, object&amp;gt; parameter. Here&apos;s one example that won&apos;t compile anymore:&lt;/p&gt;

&lt;p&gt;    var dictionary = new Dictionary&amp;lt;string, object&amp;gt; { &lt;/p&gt;
{ &quot;x&quot;, 1 }
&lt;p&gt; };&lt;br/&gt;
    var document = new BsonDocument(dictionary);&lt;/p&gt;

&lt;p&gt;There are others that need to be found and fixed as well.&lt;/p&gt;</description>
                <environment></environment>
        <key id="20218">CSHARP-290</key>
            <summary>Ambiguity between overloads with an IDictionary or an IDictionary&lt;string, object&gt; parameter</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="robert@mongodb.com">Robert Stam</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Jul 2011 21:20:33 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:06 +0000</updated>
                            <resolved>Thu, 4 Aug 2011 17:18:09 +0000</resolved>
                                    <version>1.1</version>
                                    <fixVersion>1.2</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="46409" author="rstam" created="Thu, 4 Aug 2011 17:18:09 +0000"  >&lt;p&gt;Implemented the changes proposed in the previous comment.&lt;/p&gt;</comment>
                            <comment id="46379" author="rstam" created="Thu, 4 Aug 2011 15:52:26 +0000"  >&lt;p&gt;Current thinking:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;we should have both IDictionary and IDictionary&amp;lt;string, object&amp;gt; overloads&lt;/li&gt;
	&lt;li&gt;that causes an ambiguity when passing a Dictionary&amp;lt;string, object&amp;gt; value because it matches both&lt;/li&gt;
	&lt;li&gt;the ambiguity can be resolved by adding an overload specifically for Dictionary&amp;lt;string, object&amp;gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I have found a few other classes that implement both IDictionary and IDictionary&amp;lt;TKey, TValue&amp;gt;:&lt;/p&gt;

&lt;p&gt;ConcurrentDictionary&lt;br/&gt;
SortedDictionary&lt;br/&gt;
SortedList&lt;/p&gt;

&lt;p&gt;but I don&apos;t think they are used frequently enough to merit adding overloads for all of them. If someone needs to pass one of these less frequently used classes as an argument they will have to put in a cast to resolve the ambiguity.&lt;/p&gt;</comment>
                            <comment id="45565" author="rstam" created="Mon, 1 Aug 2011 13:37:51 +0000"  >&lt;p&gt;Good point. Supporting generic and non-generic interfaces at the same time is turning out to be harder than expected! Will reopen this issue.&lt;/p&gt;</comment>
                            <comment id="45542" author="onyxmaster" created="Mon, 1 Aug 2011 11:21:35 +0000"  >&lt;p&gt;Unfortunately, this change breaks existing code, because IDictionary&amp;lt;string, object&amp;gt; does not implement IDictionary interface, so if you&apos;re passing the IDictionary&amp;lt;string, object&amp;gt; instead of a Dictionary&amp;lt;string, object&amp;gt;, it fails since there&apos;s an ambiguity.&lt;/p&gt;</comment>
                            <comment id="44989" author="rstam" created="Thu, 28 Jul 2011 03:23:26 +0000"  >&lt;p&gt;Removed overloads with IDictionary&amp;lt;string, object&amp;gt; parameter. The remaining overload with non-generic IDictionary argument can take generic IDictionary&amp;lt;string, object&amp;gt; argument values and will do the the right thing with them. This solves the ambiguity caused by having two similar overloads.&lt;/p&gt;

&lt;p&gt;NOTE: this is a breaking change at the binary level because we have removed an overload. But at the source code level it shouldn&apos;t break any client code, which must merely be recompiled to work with this change.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh8lj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14192</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>