Commit ae7176e3

ae7176e32942Merged

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

Description

RUBY_DESCRIPTION constant as a String

Reading RUBY_DESCRIPTION fell through to the unresolved-constant error. Resolve it to a small engine string and type it as TY_STRING so .class and .name dispatch. (Symbol#id2name and Range#minmax in the same test already worked.)

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

Details

Commit
ae7176e32942
Parent
5ba5709af100

src/analyze.cmodifiedView file

@@ -877,7 +877,9 @@
877877 if (!strcmp(ty, "ConstantReadNode")) {
878878 const char *nm = nt_str(nt, id, "name");
879879 LocalVar *lv = nm ? comp_const(c, nm) : NULL;
880- return lv ? lv->type : TY_UNKNOWN;
880+ if (lv) return lv->type;
881+ if (nm && !strcmp(nm, "RUBY_DESCRIPTION")) return TY_STRING;
882+ return TY_UNKNOWN;
881883 }
882884 if (!strcmp(ty, "SelfNode")) {
883885 Scope *s = comp_scope_of(c, id);