Skip to content

Instantly share code, notes, and snippets.

@bradphelan
Last active December 21, 2015 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradphelan/9fddca0fa5f1c07ba736 to your computer and use it in GitHub Desktop.
Save bradphelan/9fddca0fa5f1c07ba736 to your computer and use it in GitHub Desktop.
using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
public static string Foo<T>( params T[] items)
{
return "A";
}
public static string Foo<T>(IEnumerable<T> items)
{
return "B";
}
static void Main()
{
List<int> items = new List<int>(){0,1,23};
Console.WriteLine(Foo(items));
Console.WriteLine(Foo("XXX"));
}
}
@bradphelan
Copy link
Author

Running this outputs

A
A

rather than

B
A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment