When clicking the "Run" (F9) button in Delphi 10.3 IDE the following error occurs:
E2531 Method 'TrySetLengthV5' requires explicit type argument(s).
After cleaning the TestProgram and clicking Build the error disappears.
This is a clear sign that something is wrong with Delphi 10.3, the IDE and/or the Delphi compiler.
To see this error in action watch this youtube video, especially near the end of it, in this video I take almost an entire day of work to create TrySetLength function for dynamic arrays:
https://youtu.be/5MxN_GzZV_A
The error mostly occurs when changing code, but it also seems to occur when re-opening the project, so this is all very strange, I have no explanation for it, besides that it might be some LLVM or C/C++ compiler kind of thing... maybe the Delphi compiler consists out of multiple compilers or something or multiple stages, it is most likely related to generics/generic methods/parameterized types... something like that.
Maybe this error message is caused by my work around using var untyped parameters in a routine to work around this Delphi compiler/language limitation.
That could explain it/a lot, kinda funny that I managed to work around it, but you guys kinda didn't and did not manage to detect this work around and disallow, or maybe use it... but it's kinda strange, sometimes the work around seems to work/be allowed... and then sometimes it's not allowed/doesn't work... so that is very strange indeed ! Maybe some kind of memory corruption going on during the compiler process or language parser or instruction generator, maybe just an artifact/bug/problem in the in-memory compiler used to produce hint/warning messages etc... maybe for insight...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Delphi 10.3 warning:
// I am very curious if Delphi 11 has the same problem or not...
// Delphi 11 not tested yet...
// WARNING: changing the constant array can lead to strange compile/build errors
// Error when trying to run it without rebuilding:
// [dcc32 Error] TestProgram.dpr(32): E2531 Method 'TrySetLengthV5' requires explicit type argument(s)
// SOLUTION/FIX: clean the project and build it again.
// example of compile/build problem in Delphi 10.3:
// changing from
var
vIntegerArray : array of array of array of integer;
begin
if TTrySetLengthHelper.TrySetLengthV5( vIntegerArray, [100,200,300] ) then
// ...
end
// to
var
vIntegerArray : array of array of array of array of integer;
begin
if TTrySetLengthHelper.TrySetLengthV5( vIntegerArray, [100,200,300,400] ) then
// ...
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
Bye for now,
Skybuck Flying.