Skip to content

Commit

Permalink
Include checking for "this" when dealing with CSharpBinderFlags.Invok…
Browse files Browse the repository at this point in the history
…eSimpleName
  • Loading branch information
siegfriedpammer committed Jan 19, 2021
1 parent f52ce79 commit 3d26536
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ protected internal override TranslatedExpression VisitDynamicInvokeMemberInstruc
{
Expression targetExpr;
var target = TranslateDynamicTarget(inst.Arguments[0], inst.ArgumentInfo[0]);
if (inst.BinderFlags.HasFlag(CSharpBinderFlags.InvokeSimpleName))
if (inst.BinderFlags.HasFlag(CSharpBinderFlags.InvokeSimpleName) && target.Expression is ThisReferenceExpression)
{
targetExpr = new IdentifierExpression(inst.Name);
((IdentifierExpression)targetExpr).TypeArguments.AddRange(inst.TypeArguments.Select(ConvertType));
Expand Down

0 comments on commit 3d26536

Please sign in to comment.