Skip to content

Commit

Permalink
fix a bug in but
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jun 13, 2024
1 parent 080cb87 commit 4204e7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compile/modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,13 @@ impl Compiler {
},
);
}
if sig.args > 2 {
if sig.outputs >= 2 {
instrs.push(Instr::PushTemp {
stack: TempStack::Inline,
count: sig.args - 2,
count: sig.outputs - 1,
span,
});
for _ in 0..sig.args - 2 {
for _ in 0..sig.outputs - 1 {
instrs.push(Instr::Prim(Flip, span));
instrs.push(Instr::PopTemp {
stack: TempStack::Inline,
Expand Down
6 changes: 6 additions & 0 deletions tests/units.ua
Original file line number Diff line number Diff line change
Expand Up @@ -628,3 +628,9 @@ repr[{[[1 2][2 3]][3 4]}{[[1 2][2 3]]□{[[1 2][2 3]]□□[3 4]}}]
⍤⟜≍: 3 ⍤⟜≍: □1 ⋊aZ {1 2 3}
⍤⟜≍: [1 3 2] °⋊acb 1 2 3
⍤⟜≍: [1 3 2] °(°[⊙⊙∘]⊏0_2_1) 1 2 3

# But
⍤⟜≍: [3 ¯3] [⫯¯ 3]
⍤⟜≍: [5 8] [⫯+ 3 5]
⍤⟜≍: [4 1 2 3 4] [⫯⊙⊙⊙∘ 1 2 3 4]
⍤⟜≍: [4 1 2 3] [⫯⊙⊙⊙◌ 1 2 3 4]

0 comments on commit 4204e7f

Please sign in to comment.