<a href="http://cache.codebot.org/snapshops/managederror.jpg">http://cache.codebot.org/snapshops/managederror.jpg</a><div><br></div><div>I put a few lines to test what's going on before the error occurs and a screenshot is provided above. WriteLn is writing out a random integer value. I don't see any code in the assembler window to initialize the result. In that screenshot the test is getting ready to encounter an access violation on assignment of nil to FProp.</div>
<div><br></div><div><div>Result.FProp := nil; // ERROR: will occur here</div></div><div><br></div><div>The problem is this sort of thing is happening for me right now in a lot of places, for example when I resize a dynamic array holding a TVec(N)Prop types, or when I have a local variable.</div>
<div><br></div><div>You can actually see in that screenshot what I had tried to fix this problem previously. That is, putting code like this as the first line in some methods:</div><div><br></div><div><div>UIntPtr(Result.FProp) := 0;</div>
</div><div><br></div><div>This works somewhat, but in other places this isn't possible or is very impractical:</div><div><br></div><div><div>procedure TList<TItem>.DeleteItem(var Item: ItemType); { virtual }</div>
<div>begin</div><div>  Item := default(TItem); // BOOM when TItem is TVec(n)Prop</div><div>end;</div><div> </div></div><div><br></div><div><br></div>