When passing an initialised array as an aliased formal, the compiler complains: mem.adb:13:11: untagged actual does not match aliased formal "B" Source: procedure Mem is type IA is array (Positive range <>) of Integer; type IA_Ptr is access all IA; procedure Inner (B : aliased in out IA) is null; -- S : aliased IA (1 .. 10) := (others => 0); -- This does not work for some reason?? -- S : aliased IA (1 .. 10) := (1 .. 10 => 0); -- This does not work for some reason?? -- S : aliased IA := (1 .. 10 => 0); -- This works. -- S : aliased IA := (0, 1, 2, 3, 4, 5); -- This works. begin Inner (S); end Mem;
Static subtype matching is required between formal and actual.