Skip to content

Fix unannotated Box::unwrap let lowering to int - #12

Merged
Cod-e-Codes merged 1 commit into
mainfrom
fix/box-unwrap-unannotated-let
Aug 12, 2026
Merged

Fix unannotated Box::unwrap let lowering to int#12
Cod-e-Codes merged 1 commit into
mainfrom
fix/box-unwrap-unannotated-let

Conversation

@Cod-e-Codes

@Cod-e-Codes Cod-e-Codes commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • IR let typing for unannotated let n = Box::unwrap(boxed) now peels Box<T> via the same Call return-type helper as build_expr, so n is T (for example Node) instead of default int.
  • This impacts unannotated Box::unwrap when T is a user struct or any non-int payload. Annotated let n: Node = ... already lowered correctly.
  • Adds test_box_unwrap_struct_let.ion (run + cgen) and a cgen unit test asserting Node* _box rather than int* _box.

Test plan

  • cargo fmt / clippy -D warnings / cargo test
  • tests/test_runner.sh (276/276)
  • ion-build all examples; run non-interactive ones
  • CI green on this PR

@Cod-e-Codes
Cod-e-Codes merged commit a3dcd1f into main Aug 12, 2026
7 checks passed
@Cod-e-Codes
Cod-e-Codes deleted the fix/box-unwrap-unannotated-let branch August 12, 2026 22:23
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