Repository navigation
R-1a: an equation's value is never a promise (MISSING_AWAIT) - #19
Merged
Merged
Conversation
An equation lowers to a memo, and Solid's memo consumes a promise or async iterable its function returns, so R-1's "a Promise-valued expression without await is an ordinary value" contradicted the lowering. The type projection now wraps each equation as __.eq(e), which refuses a promise or a stream on any branch as MISSING_AWAIT (13 TY-5b). `any` stays silent; noted in R-1a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWMgQnVJdZuGmj1hSdC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Ryan · project thread
Why
R-1 said "a Promise-valued expression without
awaitis an ordinary value of type Promise and is never pending." The compiled app does something else.x = fetchUser(id)lowers to a memo, and Solid's memo consumes a promise its function returns. Checked on the pinned next (ac28157a):createMemo(() => promise)read by an effect gives42, not a Promise. So the spec, the interpreter and the checker treatedxas a value, while the compiled app treated it as pending.What
MISSING_AWAIT. A promise inside a value ({ p },[a, b]) is not consumed. Where the type isany, the check is silent and Solid still consumes the promise. Refusing anany-typed JS import call withoutawaitis noted as possible future work, not adopted.__.eq(e, true). The new preludeeq<T>refuses a promise or a stream, following the same pattern asWIRE_VALUE(TY-5a). There is no run-time cost.MISSING_AWAITrows added to the 04 table and to 99.ref/types/project.ts,ref/types/run.ts(reportsMISSING_AWAITby name),compiler/src/project.rsandcompiler/src/prelude.ts.?:.awaitstays the marker for where async enters the graph (R-1, AC-1b/c/d,ASYNC_WATERFALL). This change only makes the missing marker an error instead of silently doing something different.Checked
npm run types: 146 pass, 0 fail. No existing scenario or example equation held a promise.RX_CRATE=1 npm run types: 146 pass, 0 fail.npm run crate: 307/307 programs agree.npm run crate -- --project: 178/178 projections are identical, and all position mappings hold.npm test: all scenarios pass.cargo test: passes.Generated by Claude Code