DeepCopy icon indicating copy to clipboard operation
DeepCopy copied to clipboard

The issue of array copy

Open tangdf opened this issue 6 years ago • 0 comments

Demo Code:

            var originalArray = new string[] { "123", "hello!" };
            var resultArray = DeepCopier.Copy((object)original);
            Assert.Equal(originalArray, resultArray);
            Assert.NotSame(originalArray, resultArray);

Stace Trace:

System.ArgumentException : Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type. at System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags, StackCrawlMark& stackMark) at System.Reflection.RuntimeMethodInfo.CreateDelegate(Type delegateType) at DeepCopy.CopierGenerator1.CreateArrayCopier(Type type) at DeepCopy.CopierGenerator1.CreateCopier(Type type) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at DeepCopy.CopierGenerator`1.Copy(T original, CopyContext context) at DeepCopy.DeepCopier.Copy[T](T original) at DeepCopy.UnitTests.CopyTests.CanCopyArrays()

tangdf avatar Apr 19 '18 08:04 tangdf