Commit ab11aa0
committed
Test the ifelse() rank-mismatch error, drop an unreachable guard
Coverage flagged both stop() calls in check_ifelse_branch_shape() as
untested.
The rank check is reachable: a matrix branch under a vector `test`, or
the reverse, hits it, and the existing mismatch test only exercises the
per-axis verdict. Add a case for each direction.
The `is.null(hoist)` arm is not reachable. r2f() replaces a NULL hoist
with a fresh one before dispatching to any handler, and the only other
dispatch route resolves `f<-`-style names, so the ifelse() handler
always has a hoist to emit the size guard into. Delete it and record
the invariant in the function's comment rather than testing dead code.1 parent e1b3e77 commit ab11aa0
2 files changed
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 62 | | |
68 | 63 | | |
69 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
| |||
0 commit comments