Re: [fpc-pascal] Open array compatibility

2022-10-15 Thread Hairy Pixels via fpc-pascal
> On Oct 15, 2022, at 3:58 PM, Michael Van Canneyt > wrote: > > One reason we do not allow descendents is that if you have a var array, the > returned value may contain classes of a type that the caller does not expect. > (This is the same reason why (var value: TObject) requires an exact matc

Re: [fpc-pascal] Open array compatibility

2022-10-15 Thread Michael Van Canneyt via fpc-pascal
On Sat, 15 Oct 2022, Hairy Pixels via fpc-pascal wrote: 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

[fpc-pascal] Open array compatibility

2022-10-15 Thread Hairy Pixels via fpc-pascal
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: arra