Skip to content

Commit 3688864

Browse files
committed
fix a bug in sided reach
1 parent 47061fb commit 3688864

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/compile/modifier.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,11 @@ impl Compiler {
502502
node = Node::Mod(Dip, eco_vec![SigNode::new(sn.sig, node)], span);
503503
node.prepend(Node::Prim(Flip, span));
504504
}
505-
SubSide::Right => node.prepend(Node::Mod(
506-
Dip,
507-
eco_vec![SigNode::new((2, 2), Node::Prim(Flip, span))],
508-
span,
509-
)),
505+
SubSide::Right => {
506+
node.prepend(Node::Prim(Pop, span));
507+
node = Node::Mod(Off, eco_vec![node.sig_node().unwrap()], span);
508+
node.prepend(Node::Prim(Flip, span));
509+
}
510510
}
511511
} else {
512512
node.prepend(Node::Mod(

tests/units.ua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ path(
542542
⍤⤙≍ [1 2 3 6] [◠(++)] 1 2 3
543543
⍤⤙≍ [1 2 ¯1 2] [◠(¯⊙∘)] 1 2
544544

545+
# Reach
546+
⍤⤙≍ 4 𝄐+ 1 2 3
547+
⍤⤙≍ {@b "acd"} {𝄐⌞⊟₃} @a@b@c@d
548+
⍤⤙≍ {"acd" @b} {𝄐⌟⊟₃} @a@b@c@d
549+
545550
# Derivative
546551
⍤⤙≍ 10 ∂(×.) 5
547552
⍤⤙≍ 1.5 ∂√ 1/9

0 commit comments

Comments
 (0)