Commit eda5ca27

eda5ca27a501Merged

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

Description

fix: use strcmp for string case/when, fix ARGV indexing, improve type inference

Three fixes for self-hosting support:

  1. case/when with string predicate now uses strcmp() instead of pointer comparison (==) in both statement and expression contexts. This was causing all string dispatches to silently fail in compiled binaries.

  2. ARGV[n] now generates sp_argv.data[n] instead of sp_argv[n], which was a struct subscript error.

  3. Type inference for class method parameters now searches all classes (not just the current one) when resolving method calls on parameters. The body scan also recurses into case/when, if/else, while, unless, and return nodes. MAX_IVARS raised from 48 to 96 for large classes.

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
eda5ca27a501
Parent
f9bf1778d3ca

src/codegen.hmodifiedView file

@@ -82,7 +82,7 @@
8282 } method_info_t;
8383
8484 /* Class info */
85-#define MAX_IVARS 48
85+#define MAX_IVARS 96
8686 #define MAX_METHODS 96
8787 #define MAX_INCLUDES 16
8888 typedef struct {