[fpc-pascal] := overload with implicit arrays in generics
Ryan Joseph
ryan at thealchemistguild.com
Sat Jun 2 08:05:20 CEST 2018
Is this is a bug or am I not doing something right? I wanted to assign an implicit array (I think thats what those parameters are being called now) so I made an overload but the compiler is complaining. Using single characters gives a different error because the compiler thinks it’s an array of char instead of array of string.
type
generic TMyCollection<T> = record
class operator := (values: array of T): TMyCollection;
end;
class operator TMyCollection.:= (values: array of T): TMyCollection;
begin
end;
var
c: specialize TMyCollection<string>;
begin
c := ['aaa', 'bbb', 'ccc’]; // Ordinal expression expected
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list