Skip to content

fix: nested inline object literals use correct struct type (#36)#312

Merged
cs01 merged 3 commits intomainfrom
reduce-test-skips
Mar 13, 2026
Merged

fix: nested inline object literals use correct struct type (#36)#312
cs01 merged 3 commits intomainfrom
reduce-test-skips

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 13, 2026

Summary

  • Fixes nested inline object literals generating wrong struct types in native compiler
  • { start: { x: 10, y: 20 }, end: { x: 30, y: 40 } } now correctly allocates inner objects as %Point instead of inheriting outer %Line type
  • Root cause: native compiler reads garbled .type field on inner AST expressions ("o" + garbage instead of "object"), so the valueExpr.type === "object" check always failed
  • Fix: detect object literals using charCodeAt(0) === 111 (ASCII 'o') instead of full string comparison, then call generateInterfaceObject directly with the resolved inner interface type
  • Unskips nested-inline-object.ts test (was @test-skip since issue add http response/request headers, serveEmbedded, and header tests #36)

Test plan

  • JS compiler: TEST_PASSED
  • Native compiler: TEST_PASSED (was FAIL start: 0,0)
  • verify:quick passes (tests + Stage 1 self-hosting)

@cs01 cs01 merged commit fa6d51e into main Mar 13, 2026
12 checks passed
@cs01 cs01 deleted the reduce-test-skips branch March 13, 2026 01:57
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