Calling other constructors

4 posts, 0 answers
  1. Davo
    Davo avatar
    3 posts
    Member since:
    Apr 2011

    Posted 28 Apr 2011 Link to this post

    It appears that passing parameters from one constructor to another isn't picked up by JD.

    Expected:
    protected Option(string prototype, string description) : this(prototype, description, 1)
    {
    }


    JD output:
    protected Option(string prototype, string description)
    {
    }
  2. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    409 posts

    Posted 04 May 2011 Link to this post

    Hello Davo,

     Yep, we seem to have this problem. Thanks for letting us know. We are gonna try fixing that before the official release.

    Kind regards,
    Tsviatko Yovtchev
    the Telerik team

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

  3. DevCraft banner
  4. Adam
    Adam avatar
    2 posts
    Member since:
    Apr 2011

    Posted 12 Oct 2011 Link to this post

    I have a similar scenario where "base" appears, but incorrectly:

    When you have "readonly", inline-declared items within the class, the "base" is actually there this time, but it is put where it isn't valid C# (right after the inline-declared values are called in the constructor). The inline declarations being moved to the constructor may be congruent with the compiled results of that shorthand (haven't confirmed), but that "base" call definitely got bumped out of place.

    Original:
    public class Class2 : Class1 {
        private readonly string _snippetsImageSmall = "readonly string";
        private Dictionary<string, string> _snippets = new Dictionary<string, string>();
        public string Something { get; set; }
     
        public Class2()
            : base("othertest", "value") {
     
            // Need something here that won't be optimized away completely.
            this.Something = "x";
        }
    }

    JustDecompile Output:
    public class Class2 : Class1
    {
        private readonly string _readonlyString;
     
        private Dictionary<string, string> _someInitializedField;
     
        public string Something
        {
            get;
            set;
        }
     
        public Class2()
        {
            this._readonlyString = "readonly string";
            this._someInitializedField = new Dictionary<string, string>();
            base("othertest", "value");
            this.Something = "x";
        }
    }
  5. Nikolay G Rusev
    Admin
    Nikolay G Rusev avatar
    44 posts

    Posted 18 Oct 2011 Link to this post

    Hello Adam,

    Thank you for the feedback. We know about this issue and we have it logged so it will definitely be fixed in a future release. Keep the feedback coming. It is much appreciated.

    Greetings,
    Nikolay G Rusev
    the Telerik team

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

Back to Top