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:
-
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.
-
ARGV[n] now generates sp_argv.data[n] instead of sp_argv[n], which was a struct subscript error.
-
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
} method_info_t;/* Class info */#define MAX_IVARS 48#define MAX_IVARS 96#define MAX_METHODS 96#define MAX_INCLUDES 16typedef struct {src/expr.cmodifiedView file
Loading diff…
src/stmt.cmodifiedView file
Loading diff…
src/type.cmodifiedView file
Loading diff…