Skip to content

Commit

Permalink
Fix closure
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-artur committed Jan 20, 2025
1 parent 28b8715 commit 2c159ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Castle.Core/DynamicProxy/Internal/InvocationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static MethodInfo GetMethodOnType(Type type, MethodInfo proxiedMethod)

var cacheKey = new CacheKey(proxiedMethod, type);

return cache.GetOrAdd(cacheKey, ck => ObtainMethod(proxiedMethod, type));
return cache.GetOrAdd(cacheKey, static ck => ObtainMethod(ck.Method, ck.Type));
}

private static MethodInfo ObtainMethod(MethodInfo proxiedMethod, Type type)
Expand Down
4 changes: 2 additions & 2 deletions src/Castle.Core/DynamicProxy/ProxyUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ public static bool IsAccessible(Type type)
/// <param name="asm">The assembly to inspect.</param>
internal static bool AreInternalsVisibleToDynamicProxy(Assembly asm)
{
return internalsVisibleToDynamicProxy.GetOrAdd(asm, a =>
return internalsVisibleToDynamicProxy.GetOrAdd(asm, static a =>
{
var internalsVisibleTo = asm.GetCustomAttributes<InternalsVisibleToAttribute>();
var internalsVisibleTo = a.GetCustomAttributes<InternalsVisibleToAttribute>();
return internalsVisibleTo.Any(attr => attr.AssemblyName.Contains(ModuleScope.DEFAULT_ASSEMBLY_NAME));
});
}
Expand Down

0 comments on commit 2c159ad

Please sign in to comment.