<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Generic Method Overloading Selection Pitfall</title>
	<atom:link href="http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html</link>
	<description>Productive software development using ASP.NET, C#, Adobe Flex, and other technologies and tools.</description>
	<lastBuildDate>Thu, 11 Mar 2010 22:16:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jigit</title>
		<link>http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html/comment-page-1#comment-1307</link>
		<dc:creator>jigit</dc:creator>
		<pubDate>Mon, 26 Jan 2009 20:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html#comment-1307</guid>
		<description>Аксиома с тоской вспоминала то время, когда она была еще теоремой...</description>
		<content:encoded><![CDATA[<p>Аксиома с тоской вспоминала то время, когда она была еще теоремой&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html/comment-page-1#comment-1262</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sun, 04 Jan 2009 15:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html#comment-1262</guid>
		<description>i knew i was missing something...sorry about that.</description>
		<content:encoded><![CDATA[<p>i knew i was missing something&#8230;sorry about that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html/comment-page-1#comment-1259</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 03 Jan 2009 15:12:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html#comment-1259</guid>
		<description>Mike, in your example, you&#039;re specifying the type when you call the generic method. That forces it to match the correct signature. I was trying to show that when you don&#039;t specify the type, and you simply use type inference, it chooses the other signature.

So to modify your example, change this line:
DoSomething&lt;int&gt;(i);
to this:
DoSomething(i);

I should have made it more clear how I was calling the generic method.</description>
		<content:encoded><![CDATA[<p>Mike, in your example, you&#8217;re specifying the type when you call the generic method. That forces it to match the correct signature. I was trying to show that when you don&#8217;t specify the type, and you simply use type inference, it chooses the other signature.</p>
<p>So to modify your example, change this line:<br />
DoSomething&lt;int&gt;(i);<br />
to this:<br />
DoSomething(i);</p>
<p>I should have made it more clear how I was calling the generic method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html/comment-page-1#comment-1256</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 03 Jan 2009 14:59:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.ytechie.com/2009/01/generic-method-overloading-selection-pitfall.html#comment-1256</guid>
		<description>Did you try this?  Or just post the example wrong?  There is no way this could be correct.  Just fill in the blanks and you can see it:

List&lt;int&gt; i = new List&lt;int&gt;();

DoSomething&lt;int&gt;(i);

static void DoSomething&lt;T&gt;(IEnumerable&lt;T&gt; o)
{
	Console.WriteLine(&quot;IEnumerable&quot;);
}

static void DoSomething&lt;T&gt;(T o)
{
	Console.WriteLine(&quot;Nope&quot;);
}</description>
		<content:encoded><![CDATA[<p>Did you try this?  Or just post the example wrong?  There is no way this could be correct.  Just fill in the blanks and you can see it:</p>
<p>List&lt;int&gt; i = new List&lt;int&gt;();</p>
<p>DoSomething&lt;int&gt;(i);</p>
<p>static void DoSomething&lt;T&gt;(IEnumerable&lt;T&gt; o)<br />
{<br />
	Console.WriteLine(&#8220;IEnumerable&#8221;);<br />
}</p>
<p>static void DoSomething&lt;T&gt;(T o)<br />
{<br />
	Console.WriteLine(&#8220;Nope&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
