I can't get async to work with override. I've put together a simple class that calls the browser SHA API with the definitions:
TBaseSHA256 = class
public
function ComputeSHA256(const s: string): string; virtual; abstract;
end;
TSHA256 = class(TBaseSHA256)
private
private
function Hex(ABuffer: TJSArrayBuffer): string;
public
//[async]
function ComputeSHA256(const s: string): string; async; override; {async;}
end;
I've tried all combinations of [async]/async; but the compiler gives me "[Error] UnitMain.pas(23): procedure type modifier "async" mismatch".
Thanks, Bob
Never mind - I forgot to add async to the original declaration!
Thanks, Bob
Tunde
(Tünde Keller)
3
Hi,
You need to make sure your abstract function is marked as async too.
TBaseSHA256 = class
public
[async]
function ComputeSHA256(const s: string): string; virtual; abstract;
end;
TSHA256 = class(TBaseSHA256)
private
private
function Hex(ABuffer: TJSArrayBuffer): string;
public
[async]
function ComputeSHA256(const s: string): string; override;
end;
or
TBaseSHA256 = class
public
function ComputeSHA256(const s: string): string; async; virtual; abstract;
end;
TSHA256 = class(TBaseSHA256)
private
private
function Hex(ABuffer: TJSArrayBuffer): string;
public
function ComputeSHA256(const s: string): string; async; override;
end;
system
(system)
Closed
4
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.