Created
August 22, 2012 01:49
-
-
Save masaru-b-cl/3421373 to your computer and use it in GitHub Desktop.
コレクション初期化子がコンパイルエラーにならない条件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Collections; | |
namespace ConsoleApplication1 | |
{ | |
class MyCollection : IEnumerable | |
{ | |
public void Add(string value) | |
{ | |
} | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var col = new MyCollection { "1" }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment