Merge pull request #3097 from AleoHQ/fix/codegen-for-futures

[Fix] Codegen for futures.
This commit is contained in:
d0cd 2023-10-27 15:24:15 -04:00 committed by GitHub
commit 35a913327c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,7 @@ impl<'a> CodeGenerator<'a> {
// If the function contained calls that produced futures, then we need to add the futures to the finalize block as input.
// Store the new future registers.
let mut future_registers = Vec::new();
for (_, future_type) in &self.futures {
for (_, future_type) in self.futures.drain(..) {
let register_string = format!("r{}", self.next_register);
writeln!(function_string, " input {register_string} as {future_type}.future;")
.expect("failed to write to string");