sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 181 forks source link

VS 2010 editor complains "Cannot apply indexing to an expression of type C5.IDictionary<...>" #12

Closed chronodm closed 11 years ago

chronodm commented 11 years ago

When I try to use the bracket operator with an IDictionary or a HashDictionary, e.g.:

            var myDict = new HashDictionary<String, String>();
            myDict["foo"] = "bar";

it compiles fine, but the editor gives me a wavy line and the above error. I'm guessing this is a problem with my tools, more than the library, but have you seen it and/or do you have any idea how to fix it? I can work around it with Find() and UpdateOrAdd(), but the bracket syntax would be a lot nicer.

I'm using version 2.1.4492.18142, from NuGet, with VS 2010, C# 4.0, and Resharper.

ondfisk commented 11 years ago

There was a bug in the NuGet package which published the C5.Mono.dll along with the standard one, confusing the compiler. It should be fixed in todays release - Update-Package C5...