Skip to content

fix: Array.from(string) returns string[] without type annotation#398

Merged
cs01 merged 1 commit intomainfrom
fix/array-from-string
Mar 14, 2026
Merged

fix: Array.from(string) returns string[] without type annotation#398
cs01 merged 1 commit intomainfrom
fix/array-from-string

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 14, 2026

Summary

  • Array.from("hello") now correctly produces a string[] without needing an explicit type annotation
  • Previously, the variable allocator classified the result as i8* (string) instead of %StringArray*, causing garbage values on index access
  • Root cause: resolveMethodCallByObjectType returned number[] for all Array.from() calls before the string-aware handler could run

Test plan

  • New test fixture arrays/array-from-string.ts
  • All existing tests pass
  • Self-hosting (Stage 0 + Stage 1) passes

🤖 Generated with Claude Code

@cs01 cs01 force-pushed the fix/array-from-string branch from 05a2e60 to ffa3d2b Compare March 14, 2026 14:21
@cs01 cs01 merged commit 3d852c5 into main Mar 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant