Skip to content

fix(compiler): embed unknown constants via print-dup and RT.readString#84

Merged
skydread1 merged 3 commits into
developfrom
fix/83-print-dup-constant-fallback
Jul 22, 2026
Merged

fix(compiler): embed unknown constants via print-dup and RT.readString#84
skydread1 merged 3 commits into
developfrom
fix/83-print-dup-constant-fallback

Conversation

@skydread1

Copy link
Copy Markdown
Member

Closes #83

load-constant enumerated its supported constant types and threw for anything else, so #inst (System.DateTime), #uuid (System.Guid) and any custom tagged literal in compiled source could not compile.

  • The :default method now mirrors the stock compilers' ObjExpr.EmitValue fallback. It prints the constant under *print-dup*, emits RT.readString on the embedded string, and converts the result to the constant's static type (unbox.any for value types).
  • A constant whose type has no print-dup fails at compile time with the stock wording instead of the old internal message.
  • Regression tests cover the #inst and #uuid round-trips, the fallback inside a collection constant, and the no-print-dup compile error. A smoke check covers the new load-time path under IL2CPP.

#83)

load-constant enumerated its supported types and threw for anything
else, so #inst (System.DateTime), #uuid (System.Guid) and any custom
tagged literal in compiled source could not compile. The :default
method now mirrors the stock compilers' ObjExpr.EmitValue fallback:
print the constant under *print-dup*, emit RT.readString on the
string, and convert the result to the constant's static type
(unbox.any for value types).
@skydread1 skydread1 self-assigned this Jul 22, 2026
@skydread1
skydread1 merged commit 14123b6 into develop Jul 22, 2026
1 check passed
@skydread1
skydread1 deleted the fix/83-print-dup-constant-fallback branch July 22, 2026 15:05
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.

#inst and #uuid literals in compiled source throw load-constant not implemented

1 participant