Decompiling Indexed Setters Doesn't Work

3 posts, 1 answers
  1. Dan
    Dan avatar
    2 posts
    Member since:
    Jun 2011

    Posted 29 Jun 2011 Link to this post

    Hi,

    Thanks for a pretty awesome tool - liking the UI and feel. Some of the code produced is much more "real world" than other tools in the area.

    Got an issue with decompiling indexed setters. Quick sample follows:

    using System;
    using System.Collections.Generic;
     
    namespace TestIndexerDecomp{
       static class Program{
          static void Main(string[] args)
          {
             var something = new SomeClass();
             Console.WriteLine("Begin");
             something["fred"] = "foo";
             Console.WriteLine("Some things from something: {0}; {1}",
                something["one"], something["fred"]);
             Console.WriteLine("End");
             Console.ReadLine();
          }
       }
        
       public class SomeClass{
           
          private IDictionary<string, string> _data;
           
          public string this[string reference]
          {
             get
             {
                return _data[reference];
             }
             set
             {
                _data[reference] = value;
             }
          }
           
          public SomeClass()
          {
             _data = new Dictionary<string,string>();
             _data["one"] = "One";
             _data["two"] = "Two";
             _data["three"] = "Three";
          }
       }
    }

    Produces this for the Main() method:

    private static void Main(string[] args)
    {
        SomeClass someClass = new SomeClass();
        Console.WriteLine("Begin");
        someClass.Item = "fred";
        Console.WriteLine("Some things from something: {0}; {1}", someClass["one"], someClass["fred"]);
        Console.WriteLine("End");
        Console.ReadLine();
    }

    The indexed setter just becomes xxxx.Item = "index" rather than the expexted xxxx["index"] = whatever.

    This is using Version: Beta 2011.1.624.2

  2. Answer
    Nikolay G Rusev
    Admin
    Nikolay G Rusev avatar
    44 posts

    Posted 04 Jul 2011 Link to this post

    Hello Dan,

     Thanks a bunch for the feedback and the good word.

    We already know about this problem and we are going to fix it in some of the next product updates. Please, stay tuned.

    Regards,
    Nikolay G Rusev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
  4. Dan
    Dan avatar
    2 posts
    Member since:
    Jun 2011

    Posted 04 Jul 2011 Link to this post

    Hello,

    Thanks for the update. Apologies for posting about a known issue - tried the issue tracking service but it didn't want to play. Look forward to the update.

    Thanks again,

    Dan
Back to Top