Commit 73b81b09
73b81b091bcaMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified
Description
Fix key?/has_key? on poly hash recv + sp_raise_exc for exc objects
- Include has_key?/key? in poly dispatch is_include check
- Allow raises of sp_Exception objects via sp_raise_exc
- Add sp_exc_new_for_catch for rescue binding with parent hierarchy
Co-Authored-By: Claude Sonnet 4.6 [email protected]
Details
- Commit
- 73b81b091bca
- Parent
- 96efde026835
src/codegen.cmodifiedView file
@@ -6489,7 +6489,8 @@
64896489
if (recv >= 0 && rt == TY_POLY && argc > 0) {64906490
/* the builtin-array `[]` arm only applies to an integer index */64916491
int is_index = !strcmp(name, "[]") && argc == 1 && comp_ntype(c, argv[0]) == TY_INT;6492-
int is_include = (!strcmp(name, "include?") || !strcmp(name, "member?")) && argc == 1;6492+
int is_include = (!strcmp(name, "include?") || !strcmp(name, "member?") ||6493+
!strcmp(name, "has_key?") || !strcmp(name, "key?")) && argc == 1;64936494
int ncand = 0;64946495
for (int k = 0; k < c->nclasses; k++) {64956496
int mi = comp_method_in_chain(c, k, name, NULL);