Skip to content

Commit 45129de

Browse files
gao-arturstakx
authored andcommitted
Fix closure
1 parent 435c6bb commit 45129de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Castle.Core/DynamicProxy/Internal/InvocationHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static MethodInfo GetMethodOnType(Type type, MethodInfo proxiedMethod)
5050

5151
var cacheKey = new CacheKey(proxiedMethod, type);
5252

53-
return cache.GetOrAdd(cacheKey, ck => ObtainMethod(proxiedMethod, type));
53+
return cache.GetOrAdd(cacheKey, static ck => ObtainMethod(ck.Method, ck.Type));
5454
}
5555

5656
private static MethodInfo ObtainMethod(MethodInfo proxiedMethod, Type type)

src/Castle.Core/DynamicProxy/ProxyUtil.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public static bool IsAccessible(Type type)
162162
/// <param name="asm">The assembly to inspect.</param>
163163
internal static bool AreInternalsVisibleToDynamicProxy(Assembly asm)
164164
{
165-
return internalsVisibleToDynamicProxy.GetOrAdd(asm, a =>
165+
return internalsVisibleToDynamicProxy.GetOrAdd(asm, static a =>
166166
{
167-
var internalsVisibleTo = asm.GetCustomAttributes<InternalsVisibleToAttribute>();
167+
var internalsVisibleTo = a.GetCustomAttributes<InternalsVisibleToAttribute>();
168168
return internalsVisibleTo.Any(attr => attr.AssemblyName.Contains(ModuleScope.DEFAULT_ASSEMBLY_NAME));
169169
});
170170
}

0 commit comments

Comments
 (0)