1

Closed

Exceptions while cloning null-arrays

description

Thank you for the previous interface-related fix.
I have discovered two more issues. The first one can be demonstrated by the following test:
        private  class DummyTestClass
        {
            public int[] Something { get; set; }
        }

        [TestMethod]
        public void NullArrayInClassCloneTest()
        {
            DummyTestClass source = new DummyTestClass();
            source.Something = null;
            var target = source.GetClone();
            Assert.AreNotSame(source, target);
            Assert.IsFalse(object.ReferenceEquals(source, target));
        }
This will result in NullReferenceException.

For the other issue, replace int[] with Array in the DummyTestClass

This will give:
System.TypeInitializationException: The type initializer for 'CloneExtensions.CloneManager`1' threw an exception. ---> System.InvalidOperationException: Sequence contains no matching element
Closed Mar 22, 2014 at 6:02 AM by marcinjuraszek

comments

Nemo1024 wrote Mar 20, 2014 at 3:33 PM

Hi,
I am still very much interested if the issue above can be solved. Thank you in advance.

wrote Mar 22, 2014 at 6:02 AM

Resolved with changeset 27966: Array fixes

marcinjuraszek wrote Mar 22, 2014 at 6:02 AM

Sorry, I forgot about that. Should work fine now.