This is a migrated thread and some comments may be shown as answers.

Decompiled code for lambdas is overly verbose

1 Answer 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 24 Nov 2015, 09:17 PM

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.

1 Answer, 1 is accepted

Sort by
0
Tsviatko Yovtchev
Telerik team
answered on 27 Nov 2015, 01:29 PM

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
Tags
General Discussions
Asked by
Craig
Top achievements
Rank 1
Answers by
Tsviatko Yovtchev
Telerik team
Share this question
or