Commit 274d5974

274d5974e6c4Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified

Description

Array#reverse_each and #each_entry

reverse_each iterates the array back to front; each_entry is each. Both bind the block param as the element type, across typed and poly arrays.

Co-Authored-By: Claude Opus 4.8 [email protected]

Details

Commit
274d5974e6c4
Parent
0184a1398359

src/analyze.cmodifiedView file

@@ -1928,6 +1928,7 @@
19281928 !strcmp(name, "find") || !strcmp(name, "detect") ||
19291929 !strcmp(name, "max_by") || !strcmp(name, "min_by") || !strcmp(name, "sort_by") ||
19301930 !strcmp(name, "take_while") || !strcmp(name, "drop_while") ||
1931+ !strcmp(name, "reverse_each") || !strcmp(name, "each_entry") ||
19311932 !strcmp(name, "each_with_index")) &&
19321933 ty_is_array(rt))
19331934 pt = ty_array_elem(rt);