record_metaclass_field |
Smart pascal source code
type TMy = class end; type TMyRecord = record c1: TClass; c2: class of TMy; end; var r: TMyRecord; if Assigned(r.c1) then WriteLn('bug1'); if r.c2 <> nil then WriteLn('bug2'); r.c1 := TObject; r.c2 := TMy; var r2 := r; WriteLn(r2.c1.ClassName); WriteLn(r2.c2.ClassName); {<<< RESULT - CONSOLE LOG >>> ----------------------------- TObject TMy ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}