Skip to content

wrong length for nested array (stat/dyn) #9

@User4martin

Description

@User4martin

run to the write line

pdr) p a1
A1 = array[1..4] of {Dynamic} Array Of LongInt = [array of LongInt (Length=5) = [0, 0, 0, 0, 0], array of LongInt (Length=0) = [], array of LongInt (Length=0) = [], array of LongInt (Length=0) = []]
  • The first sub-array correctly has 5 elements.
  • All other have zero length (despite they should have varying len)
program project1;
{$Mode objfpc}
type
  t0 = array of integer;
  t1 = array [1..4] of t0;
var
  a1: T1;

begin
  SetLength(a1[1], 5);
  SetLength(a1[2], 15);
  SetLength(a1[3], 0);
  SetLength(a1[4], 1);

write;
end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions