Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix codegen for array init expressions #8446

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/passes/src/code_generation/visit_expressions.rs
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ impl<'a> CodeGenerator<'a> {
input.elements.iter().map(|expr| self.visit_expression(expr)).fold(
(String::new(), String::new()),
|(mut operands, mut instructions), (operand, operand_instructions)| {
operands.push_str(&operand);
operands.push_str(&format!(" {operand}"));
instructions.push_str(&operand_instructions);
(operands, instructions)
},
2 changes: 1 addition & 1 deletion tests/expectations/compiler/array/array_initialization.out
Original file line number Diff line number Diff line change
@@ -12,5 +12,5 @@ outputs:
destructured_ast: a289bf8f301f816aff01ea96edbd593ee691cbf6ef0899fa48dd030b4c464bf8
inlined_ast: a289bf8f301f816aff01ea96edbd593ee691cbf6ef0899fa48dd030b4c464bf8
dce_ast: a289bf8f301f816aff01ea96edbd593ee691cbf6ef0899fa48dd030b4c464bf8
bytecode: d3da9d2e824607fc466b21e88b3d1a8e9674c68f55be8d40694b6a19c80cf25c
bytecode: 5adcc7b9450eedbada20f55565a821769e58c3cacb624d7e45061693d167a079
warnings: ""
2 changes: 1 addition & 1 deletion tests/expectations/compiler/function/flatten_arrays.out
Original file line number Diff line number Diff line change
@@ -12,5 +12,5 @@ outputs:
destructured_ast: 12970e30a633c72202544f4d9fcdd174a63d0cd52595a7cb499b92baf1da028f
inlined_ast: 12970e30a633c72202544f4d9fcdd174a63d0cd52595a7cb499b92baf1da028f
dce_ast: 12970e30a633c72202544f4d9fcdd174a63d0cd52595a7cb499b92baf1da028f
bytecode: 789b22bc0c6e954ae7fed24a064342bf0729393fab7e8d8206b0923f53240dd1
bytecode: be43f1b20093160fdfc6c5f85fbbe6c3693a41505738d4d0db70b1fcf2243a4f
warnings: ""