That compiles as well because Pointer(0) is converted by the compiler to
nil.
There is even a dedicated warning for this when used in a const:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/W1013_Constant_0_converted_to_NIL_(Delphi)
Am 17.04.2018 um 13:24 schrieb Martok:
Am 17.04.2018 um
Am 17.04.2018 um 11:52 schrieb Stefan Glienke:
> FWIW this has been changed in Delphi 10.2 and does not compile anymore but
> gives:
> E2010 Incompatible types: 'Dynamic array' and 'Pointer'
That is what I would have expected.
Could you please test what the following does in D10.2?
var arr: array
FWIW this has been changed in Delphi 10.2 and does not compile anymore but
gives:
E2010 Incompatible types: 'Dynamic array' and 'Pointer'
> On 16 April 2018 at 17:21 Martok wrote:
>
>
> Hi all,
>
> I have started debugging 0031215, and discovered something slightly unrelated,
> but odd. I hope s
Am 17.04.2018 um 01:51 schrieb Thorsten Engler:
> And the nil assignment variant is pretty much ubiquitous in any code
> involving dynamic arrays that I'm aware of.
Yes. I know ;-)
>> only the reserved/constant "nil" is compatible, and handled elsewhere
I asked specifically about assigning arbit
A zero length dynamic array is represented by a nil pointer instead of a
pointer to the heap with the information that the length of the array is 0.
arr := nil;
is equivalent to:
SetLength(arr, 0);
And the nil assignment variant is pretty much ubiquitous in any code involving
dynamic arrays t