Decompiled code for lambdas is overly verbose

2 posts, 0 answers
  1. Craig
    Craig avatar
    1 posts
    Member since:
    Apr 2011

    Posted 24 Nov 2015 Link to this post

    I have the following line of code in my C# application:

    ArgumentHelpers.ThrowIfNullOrWhitespace(() => queueName);

    JustDecompile shows the following decompilation:

    ArgumentHelpers.ThrowIfNullOrWhitespace(new Expression<Func<string>>[] { Expression.Lambda<Func<string>>(Expression.Field(Expression.Constant(variable, typeof(SubscriptionInfoBase.<>c__DisplayClass17_0)), FieldInfo.GetFieldFromHandle(typeof(SubscriptionInfoBase.<>c__DisplayClass17_0).GetField("queueName").FieldHandle)), new ParameterExpression[0]) });

    ILSpy shows the following decompilation:

    ArgumentHelpers.ThrowIfNullOrWhitespace(new Expression<Func<string>>[] { () => queueName });

    It would be nice if JustDecompile generated the more concise syntax.

  2. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    409 posts

    Posted 27 Nov 2015 Link to this post

    Hi there,

    Thanks for letting us know about this problem. I really appreciate this.

    Would it be possible that you zip the assembly where that happens and send it over to me? Rather unfortunately, that seems to be the only way to reproduce that problem.


    Regards,
    Tsviatko Yovtchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top