3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-20 23:56:37 +00:00

fix return type for async wrapper functions

This commit is contained in:
Kevin Gibbons 2024-12-06 12:23:31 -08:00
parent df793f9f30
commit 2d903aae87

View file

@ -339,8 +339,10 @@ function makeTsWrapper() {
`.trim();
}
// async functions are invocations of the wrapper from make-ts-wrapper.ts
// the wrapper spawns a thread and returns void, so we need to use void as the return type here
// prettier-ignore
let invocation = `Mod.ccall('${isAsync ? "async_" : ""}${fn.name}', '${cReturnType}', ${JSON.stringify(ctypes)}, [${args.map(toEm).join(", ")}])`;
let invocation = `Mod.ccall('${isAsync ? "async_" : ""}${fn.name}', '${isAsync ? 'void' : cReturnType}', ${JSON.stringify(ctypes)}, [${args.map(toEm).join(", ")}])`;
if (isAsync) {
invocation = `await Mod.async_call(() => ${invocation})`;