Commit 626d9f7d
626d9f7ddf22Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 4 files · +2 added · ~2 modified
Description
analyze,codegen: Enumerable#member? is dispatched as include? alias
`[1,2,3].member?(2)` previously fell through to the unresolved- call path. CRuby documents member? as an alias for include?, so route both names to the same dispatch in the int_array / sym_array and str_array arms, and have analyze claim a bool return for member? too.
Fixes #969
Co-Authored-By: Claude Opus 4.7 [email protected]
Details
- Commit
- 626d9f7ddf22
- Parent
- c702a5f17c44
spinel_analyze.rbmodifiedView file
@@ -4334,7 +4334,7 @@
43344334
end43354335
end43364336
end4337-
if mname == "include?"4337+
if mname == "include?" || mname == "member?"43384338
return "bool"43394339
end43404340
if mname == "cover?"spinel_codegen.rbmodifiedView file
Loading diff…
test/array_member_alias.rbaddedView file
Loading diff…
test/array_member_alias.rb.expectedaddedView file
Loading diff…