Skip to content

Splat fallback#421

Merged
mame merged 2 commits intomasterfrom
splat-fallback
Apr 7, 2026
Merged

Splat fallback#421
mame merged 2 commits intomasterfrom
splat-fallback

Conversation

@mame
Copy link
Copy Markdown
Member

@mame mame commented Apr 7, 2026

No description provided.

mame and others added 2 commits April 7, 2026 16:57
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>
When [*x] has x typed as Array[T] | Symbol, the Symbol side doesn't
get wrapped as [Symbol] because to_a succeeds for the Array side,
making @ary non-empty and skipping the fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mame mame enabled auto-merge (rebase) April 7, 2026 08:11
@mame mame merged commit f831cdf into master Apr 7, 2026
12 checks passed
@mame mame deleted the splat-fallback branch April 7, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant