type
TForm = class(TObject)
[async] procedure MyProcedure;
constructor create;override;
end;
implementation
constructor TForm.create;
var
Obj:TOtherForm;
begin
Obj:=TOtherForm.create(MyProcedure);
end;
type
TOtherForm = class(TObject)
MyProcedure:TProc;
constructor create(ProcPoint:TProc);
end;
implementation
constructor TOtherForm.create(ProcPoint:TProc);
begin
Self.MyProcedure:=ProcPoint;
end;
Basically, I pass an async procedure to an object, which can then later be called with await();
Previously this scenario would compile. I don't know under which Web Core version this was running, but having since updated I am now presented with the error message: Got "TJSPromise", expected "TProc".
Is this expected behaviour? If so, what alternative method could I use?
I did try to rewrite the code to return a TJSPromise and pass this, but though it compiled, the promise simply runs immediately.