From ffb1ebced71c2d784db71a72958fe99fbf373256 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Wed, 11 Dec 2019 10:47:20 +0100 Subject: [PATCH] Output: Ignore static and non-public constructors when determining if an attribute should be commented out (CS7036) --- Il2CppInspector/Reflection/Extensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInspector/Reflection/Extensions.cs b/Il2CppInspector/Reflection/Extensions.cs index 21471be..f5c0e51 100644 --- a/Il2CppInspector/Reflection/Extensions.cs +++ b/Il2CppInspector/Reflection/Extensions.cs @@ -20,7 +20,7 @@ namespace Il2CppInspector.Reflection foreach (var cad in attributes) { // Find a constructor that either has no parameters, or all optional parameters - var parameterlessConstructor = cad.AttributeType.DeclaredConstructors.Any(c => c.DeclaredParameters.All(p => p.IsOptional)); + var parameterlessConstructor = cad.AttributeType.DeclaredConstructors.Any(c => !c.IsStatic && c.IsPublic && c.DeclaredParameters.All(p => p.IsOptional)); // IL2CPP doesn't retain attribute arguments so we have to comment out those with non-optional arguments if we want the output to compile var commentStart = mustCompile && !parameterlessConstructor? inline? "/* " : "// " : "";