Skip to content

fix(interp): deftype fails at its own form with a locating error - #355

Merged
csm merged 5 commits into
csm:mainfrom
BuddhiLW:upstream/deftype-locating-error
Aug 30, 2026
Merged

fix(interp): deftype fails at its own form with a locating error#355
csm merged 5 commits into
csm:mainfrom
BuddhiLW:upstream/deftype-locating-error

Conversation

@BuddhiLW

Copy link
Copy Markdown
Contributor

deftype was a builtin wired to a nil stub, so (deftype T [x y]) took the
function-application path, evaluated its args, and died on the unbound symbol T
with "Unable to resolve symbol: T" — an error that names a symbol and points
nowhere near the real cause. deftype is genuinely unimplemented (it needs
mutable/volatile fields, set! over them, and array interop).

Made it a special form that returns "deftype is not implemented (defining T);
use defrecord where a map-backed type suffices" without evaluating its args, so
the failure lands on the deftype line and says what is actually missing.
Removed the unreachable builtin registration. defrecord and reify unaffected;
suite 431/431.

deftype was a builtin wired to a nil stub, so (deftype T [x y]) took the
function-application path, evaluated its args, and died on the unbound symbol T
with "Unable to resolve symbol: T" — an error that names a symbol and points
nowhere near the real cause. deftype is genuinely unimplemented (it needs
mutable/volatile fields, set! over them, and array interop).

Made it a special form that returns "deftype is not implemented (defining T);
use defrecord where a map-backed type suffices" without evaluating its args, so
the failure lands on the deftype line and says what is actually missing.
Removed the unreachable builtin registration. defrecord and reify unaffected;
suite 431/431.
@csm csm self-assigned this Aug 29, 2026
@csm
csm self-requested a review August 29, 2026 04:01
@csm
csm merged commit 35dd5d6 into csm:main Aug 30, 2026
2 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.

2 participants