On 18.08.23 00:09, Mattias Gaertner via fpc-devel wrote:
[...]

Another point where it could wrong, is a generic method.
For example:

type
  TBird<T> = class
    procedure Fly<S>; // fpc does not yet allow this
  end;
var
  a: TBird<double>;
  b: TBird<TDateTime>;
begin
  a:=b;
a.Fly<word>; // this might call the wrong specialization or even call a non existing method
end;

So with class vars, generic methods and sub types the assignment must be forbidden. Maybe pas2js could allow it for simple arrays, pointers, records and classes.

Mattias
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to