polytronicgr / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Support increment on dictionary indexers #334

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you try to do an increment or compound assignment via a dictionary increment 
it fails at compile time e.g.

    public static void DictionaryIncrement()
    {
        var counts = new Dictionary<string, int>();

        counts["one"] = 1;

        //Not supported
        counts["one"] += 4;

        //Not supported
        counts["one"]++;
    }

with error

1>  ICSharpCode.NRefactory.CSharp.CompilerException: The method or operation is 
not implemented. ---> System.NotImplementedException: The method or operation 
is not implemented.

It would be convenient to be able to use this syntax.

Original issue reported on code.google.com by co...@gravill.com on 5 Dec 2013 at 11:33

GoogleCodeExporter commented 8 years ago

Original comment by DanelK...@gmail.com on 13 Mar 2014 at 6:33