Skip to content

Commit 4204e7f

Browse files
committed
fix a bug in but
1 parent 080cb87 commit 4204e7f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/compile/modifier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,13 @@ impl Compiler {
568568
},
569569
);
570570
}
571-
if sig.args > 2 {
571+
if sig.outputs >= 2 {
572572
instrs.push(Instr::PushTemp {
573573
stack: TempStack::Inline,
574-
count: sig.args - 2,
574+
count: sig.outputs - 1,
575575
span,
576576
});
577-
for _ in 0..sig.args - 2 {
577+
for _ in 0..sig.outputs - 1 {
578578
instrs.push(Instr::Prim(Flip, span));
579579
instrs.push(Instr::PopTemp {
580580
stack: TempStack::Inline,

tests/units.ua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,3 +628,9 @@ repr[{[[1 2][2 3]][3 4]}{[[1 2][2 3]]□{[[1 2][2 3]]□□[3 4]}}]
628628
⍤⟜≍: 3 ⍤⟜≍: □1 ⋊aZ {1 2 3}
629629
⍤⟜≍: [1 3 2] °⋊acb 1 2 3
630630
⍤⟜≍: [1 3 2] °(°[⊙⊙∘]⊏0_2_1) 1 2 3
631+
632+
# But
633+
⍤⟜≍: [3 ¯3] [⫯¯ 3]
634+
⍤⟜≍: [5 8] [⫯+ 3 5]
635+
⍤⟜≍: [4 1 2 3 4] [⫯⊙⊙⊙∘ 1 2 3 4]
636+
⍤⟜≍: [4 1 2 3] [⫯⊙⊙⊙◌ 1 2 3 4]

0 commit comments

Comments
 (0)