Sign in Join

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

Mailing lists / fpc-pascal / 2020-03

Objective-C mode switch overrides 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

The for loop thinks the open array of NSObject is an ObjectiveC array and thus gives me an error. Is this a bug?

=====================

{$mode objfpc}
{$modeswitch objectivec2}
program test;
uses
  CocoaAll;
procedure Test(input: array of NSObject);
var
  obj: NSObject;
begin
  // Incompatible types: got "{Open} Array Of NSObject" expected "NSFastEnumerationProtocol"
  for obj in input do
    ;
end;
begin
end.

Regards,
Ryan Joseph

Reply by email