Browse Source

Update ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

Co-authored-by: Siegfried Pammer <siegfried@pammer.io>
pull/3678/head
Nikita 3 weeks ago committed by GitHub
parent
commit
4dc9969afe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

2
ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{
case NewObj newObjInst:
if (newObjInst.ILStackWasEmpty && v.Kind == VariableKind.Local
&& !TypeContainsInitOnlyProperties(newObjInst.Method.DeclaringType.GetDefinition())
&& !TypeContainsInitOnlyProperties(newObjInst.Method.DeclaringTypeDefinition)
&& !currentMethod.IsConstructor
&& !currentMethod.IsCompilerGeneratedOrIsInCompilerGeneratedClass())
{

Loading…
Cancel
Save