DWScript icon indicating copy to clipboard operation
DWScript copied to clipboard

Assign anonymous record to variant

Open soinalastudio opened this issue 5 years ago • 0 comments

Hello, Why are "Anonymous record" not compatible with "Variant"? I tried to use CodeGen from dws program bellow:

program Test;

type TFunc = function(y: integer): integer;

procedure DoSomething(func: TFunc);
begin
end;

begin
 var t, y: variant;
 t := record
   name = 8;
   height = 10;
   size: record
     name = 'tool';
   end;
 end;
 
 DoSomething(lambda(y) => y+1);
 
 y.name := 7;
 
 t := y;
 
end.

The output is: there are former version of DWS that allow it. Regards,

soinalastudio avatar Sep 14 '20 10:09 soinalastudio