File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,13 +225,16 @@ private void CheckMethodBodyInstructions(MethodDefinition methodToCheck)
225225 }
226226 break ;
227227 case FieldReference fieldReference :
228- if ( ! fieldReference . Resolve ( ) . CustomAttributes . IsCompilerGenerated ( ) )
228+ if ( fieldReference . DeclaringType != _typeToCheck )
229229 {
230230 CheckTypeReference ( fieldReference . DeclaringType ) ;
231231 }
232232 break ;
233233 case MethodReference methodReference :
234- CheckTypeReference ( methodReference . DeclaringType ) ;
234+ if ( methodReference . DeclaringType != _typeToCheck )
235+ {
236+ CheckTypeReference ( methodReference . DeclaringType ) ;
237+ }
235238 break ;
236239 }
237240 }
Original file line number Diff line number Diff line change @@ -108,12 +108,7 @@ public static bool HasNullableMembers(this TypeDefinition typeDefinition)
108108
109109 public static bool IsCompilerGenerated ( this TypeDefinition typeDefinition )
110110 {
111- return typeDefinition . CustomAttributes . IsCompilerGenerated ( ) ;
112- }
113-
114- public static bool IsCompilerGenerated ( this Collection < CustomAttribute > customAttributes )
115- {
116- return customAttributes . Any ( x => x ? . AttributeType ? . FullName == typeof ( CompilerGeneratedAttribute ) . FullName ) ;
111+ return typeDefinition . CustomAttributes . Any ( x => x ? . AttributeType ? . FullName == typeof ( CompilerGeneratedAttribute ) . FullName ) ;
117112 }
118113
119114 /// <summary>
You can’t perform that action at this time.
0 commit comments