Skip to content

Assign anonymous record to variant #6

@soinalastudio

Description

@soinalastudio

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions