Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-03

Passing static arrays to open arrays

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ryan Joseph

Here's another issue I found with open arrays. Why isn't the static array of NSArray compatible with "array of pointer"? You can assign NSArray to pointer so why is the open array different?

===========

{$mode objfpc}
{$modeswitch objectivec2}
program test;
uses
  CocoaAll;
procedure Test(input: array of pointer);
begin
end;
var
  list: array[0..10] of NSArray;
  p: pointer;
begin
  // no problem!
  p := list[0];
  // Incompatible type for arg no. 1: Got "Array[0..10] Of NSArray", expected "{Open} Array Of Pointer"
  Test(list);
end.

Regards,
Ryan Joseph

Reply by email