Sorry Jay, but this is not working as it should. Your method only copies the type with its fields but not the value.
eg: test2:Testtype = New test1 is the same as
test2:TestType = New TestType
Code to prove it:
normally the test2.a should be 10 at the end but it is 5.
eg: test2:Testtype = New test1 is the same as
test2:TestType = New TestType
Code to prove it:
Strict Type testType Field a:Int Method update() a:+1 EndMethod EndType Local test1: testType = New testType For Local b = 1 To 5 test1.update Next Local test2: testtype = New test1 For Local b = 1 To 5 test1.update test2.update Next Print test1.a Print test2.a
normally the test2.a should be 10 at the end but it is 5.