I have a DUnitX test suite running fine on Win32. But when I try to compile it for Win64, this line produces a compilation error:
Assert.AreEqual(4, Length(r.Values));
[dcc64 Error] ...: E2532 Couldn't infer generic type argument from different argument types for method 'AreEqual'
r.Values is defined as:
Type TIntegers = TArray<Integer>
Assert.AreEqual has different overloaded implementations and dcc64 can't choose the right one... ok, but why? And why can dcc32 compile this without a problem?
The only clue I have is that if I hover with the mouse, Delphi will tell me that Length is of type System.Smallint. There is no Assert.AreEqual implementation with Smallint parameters... and sure enough, if I cast it to Integer, dcc64 will compile it.
But this is bugging me a lot. If I look into the System.pas unit I can see that DynArraySetLength takes a NativeInt parameter... a 64 bit integer (I'd expect unsigned, but not sure about that). So why should Length return a 16 bit signed integer? That would seem like trouble waiting to happen, right?
What am I missing?