[fpc-pascal] Open array compatibility
Hairy Pixels
genericptr at gmail.com
Sat Oct 15 10:50:19 CEST 2022
Another question I just ran in to. Why isn’t "array of TMyClass” compatible with “array of TObject” open array? TMyClass is a descendant of TObject and dynamic arrays are compatible with open arrays right?
======================
type
TMyClass = class
end;
procedure MyProcedure(values: array of TObject);
begin
end;
var
myArray: array of TMyClass;
begin
MyProcedure(myArray); // error: Incompatible type for arg no. 1: Got "{Dynamic} Array Of TMyClass", expected "{Open} Array Of TObject"
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list