From 1531302c8d9250663a5c25e3d66defa90fa268ec Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 5 Aug 2019 09:50:00 +0200 Subject: [PATCH] Fix #1611: Always remove the initializedObj dummy expression in CallBuilder.BuildDictionaryInitializerExpression --- ICSharpCode.Decompiler/CSharp/CallBuilder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ICSharpCode.Decompiler/CSharp/CallBuilder.cs b/ICSharpCode.Decompiler/CSharp/CallBuilder.cs index 020a402b5..608e60f0e 100644 --- a/ICSharpCode.Decompiler/CSharp/CallBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/CallBuilder.cs @@ -447,6 +447,9 @@ namespace ICSharpCode.Decompiler.CSharp var assignment = HandleAccessorCall(expectedTargetDetails, method, unused, argumentList.Arguments.ToList(), argumentList.ArgumentNames); + if (((AssignmentExpression)assignment).Left is IndexerExpression indexer) + indexer.Target.ReplaceWith(n => null); + if (value != null) return assignment;