Variables of non-related classes can't be assigned to each other. E.g. wrong:
f := b
type = type ...
creates a new type.
TRec2 = type TRec;
then "r := r2" will not be allowed.Do the same for classes.
TFoo2 = type TFoo;
and
f:= f2;
is not forbidden?
program Project1;
{$Mode objfpc}
type
TRec = record a: integer; end;
TRec2 = type TRec;
TFoo = class a: integer; end;
TFoo2 = type TFoo;
TBar = class a: integer; end;
var
r: TRec;
r2: TRec2;
f: TFoo;
f2: TFoo2;
b: TBar;
begin
//r := r2;
//f := b;
f := f2;
//(f as TBar).a := 1;
(f as TFoo2).a := 1;
end.