Commit d5e7aa6
Fix splat to wrap non-array types as [x] instead of calling to_a
Ruby's splat operator [*x] calls to_a on the value if it responds to
to_a, and wraps it as [x] otherwise. TypeProf was unconditionally
calling to_a, causing false "undefined method: Symbol#to_a" errors.
Now SplatBox falls back to wrapping non-array types when to_a has no
result, and the to_a MethodCallBox suppresses undefined method errors
for types that don't have to_a.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6dae086 commit d5e7aa6
3 files changed
Lines changed: 25 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
| 607 | + | |
607 | 608 | | |
| 609 | + | |
608 | 610 | | |
609 | 611 | | |
610 | 612 | | |
| |||
629 | 631 | | |
630 | 632 | | |
631 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
632 | 640 | | |
633 | 641 | | |
634 | 642 | | |
| |||
992 | 1000 | | |
993 | 1001 | | |
994 | 1002 | | |
995 | | - | |
| 1003 | + | |
996 | 1004 | | |
997 | 1005 | | |
998 | 1006 | | |
| |||
1003 | 1011 | | |
1004 | 1012 | | |
1005 | 1013 | | |
| 1014 | + | |
1006 | 1015 | | |
1007 | 1016 | | |
1008 | 1017 | | |
| |||
1014 | 1023 | | |
1015 | 1024 | | |
1016 | 1025 | | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
| |||
1062 | 1072 | | |
1063 | 1073 | | |
1064 | 1074 | | |
1065 | | - | |
| 1075 | + | |
1066 | 1076 | | |
1067 | 1077 | | |
1068 | 1078 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
0 commit comments