File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
src/Castle.Core/DynamicProxy Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -194,17 +194,20 @@ internal static bool IsAccessibleType(Type target)
194194 /// <returns><c>true</c> if the method is accessible to DynamicProxy, <c>false</c> otherwise.</returns>
195195 internal static bool IsAccessibleMethod ( MethodBase method )
196196 {
197- if ( method . IsPublic || method . IsFamily || method . IsFamilyOrAssembly )
197+ switch ( method . Attributes & MethodAttributes . MemberAccessMask )
198198 {
199- return true ;
200- }
199+ case MethodAttributes . Assembly :
200+ case MethodAttributes . FamANDAssem :
201+ return AreInternalsVisibleToDynamicProxy ( method . DeclaringType . Assembly ) ;
201202
202- if ( method . IsAssembly || method . IsFamilyAndAssembly )
203- {
204- return AreInternalsVisibleToDynamicProxy ( method . DeclaringType . Assembly ) ;
205- }
203+ case MethodAttributes . Family :
204+ case MethodAttributes . FamORAssem :
205+ case MethodAttributes . Public :
206+ return true ;
206207
207- return false ;
208+ default : // `MethodAttributes.Private` or `MethodAttributes.PrivateScope`
209+ return false ;
210+ }
208211 }
209212
210213 /// <summary>
You can’t perform that action at this time.
0 commit comments