Commit 3219570
Make RaggedEnd and RaggedRange broadcast as scalars
This fixes an issue where using `end` indexing with ragged arrays in
SymbolicIndexingInterface would fail because `RaggedEnd` was being
treated as an iterable in broadcasting contexts, causing `collect` to
be called which requires `length`.
By defining `Base.broadcastable(x::RaggedEnd) = Ref(x)` (and similarly
for `RaggedRange`), these types are now treated as scalars in
broadcasting operations, similar to how `Symbol` and `String` work.
Fixes ModelingToolkit changeofvariables test failure:
MethodError: no method matching length(::RecursiveArrayTools.RaggedEnd)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent aff3a71 commit 3219570
2 files changed
+21
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
449 | 453 | | |
450 | 454 | | |
451 | 455 | | |
| |||
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
| 467 | + | |
463 | 468 | | |
464 | 469 | | |
465 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
199 | 213 | | |
200 | 214 | | |
201 | 215 | | |
| |||
220 | 234 | | |
221 | 235 | | |
222 | 236 | | |
223 | | - | |
224 | | - | |
| 237 | + | |
| 238 | + | |
225 | 239 | | |
226 | 240 | | |
227 | 241 | | |
| |||
0 commit comments