You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce0f01e
Browse filesBrowse the repository at this point in the historyBrowse files
R-1a: an equation's value is never a promise (MISSING_AWAIT)
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
exportdeclarefunctioneq<T>(v: T,ok: Async<T>extendstrue ? "MISSING_AWAIT: an equation's value is a promise or a stream, which Solid consumes; write await e (or await* e for a stream)" : true): T;
Copy file name to clipboardExpand all lines: ref/types/project.ts
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
// `projectTsrxForTypecheck` does for `.tsrx` — and TypeScript's diagnostics are reported on `.rx` lines. Types stay
3
3
// TypeScript's (07 §2); the projection only says what each form is, as a value, to TypeScript:
4
4
// a source or an equation is a `const` of its value's type (reads are values, 02 V-1); a write is `__.set(target, v)`,
5
-
// which checks `v` against the target; an equation's `await` is `__.await(e)`, its answer's type; a view is JSX over
5
+
// which checks `v` against the target; an equation's `await` is `__.await(e)`, its answer's type, and an equation is `__.eq(e)`, never a promise (R-1); a view is JSX over
6
6
// Solid's JSX types, so a component's props and what a reader may insert are checked where they are written.
7
7
// The projection is for checking only: it is never run, and its order is the dependency order (E-7).
export declare function eq<T>(v: T, ok: Async<T> extends true ? "MISSING_AWAIT: an equation's value is a promise or a stream, which Solid consumes; write await e (or await* e for a stream)" : true): T;
28
32
export declare function first<T, I>(v: T, init: I): T | I;
29
33
export declare function pre<T>(init?: T): T;
30
34
export declare function pending(v: unknown): boolean;
if(d.k==="eq")this.w.emit(`${ind}${ex(d)}const ${d.name}${ann(d.type)} = __.eq(${this.expr(d.e,false,d.name)}, true);`,d.line);// R-1: no promise without `await`
constmsg0=ts.flattenDiagnosticMessageText(d.messageText," ");constown=/"(WIRE_VALUE):([^"]*)"/.exec(msg0);// a rule the projection states as a type
67
+
constmsg0=ts.flattenDiagnosticMessageText(d.messageText," ");constown=/"(WIRE_VALUE|MISSING_AWAIT):([^"]*)"/.exec(msg0);// a rule the projection states as a type
Copy file name to clipboardExpand all lines: spec/99-diagnostics.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,7 @@ named.
133
133
|`CONTENT_MODEL`| S | 10 SV-7d: nesting the HTML parser restructures, across templates (component roots, branches, placed children) | S-server-4 |
134
134
|`IMPORT_ROW_MISMATCH` (SF-5) | S |`server`/`client` on an import that a `.d.rx` declares otherwise | S-sf-1 |
135
135
|`WIRE_VALUE`| S/R | 12 SF-6a: at compile time where the types are known (13 TY-5a), else at run time | S-sf-1, S-types-1 |
136
+
|`MISSING_AWAIT` (new) | S | 04 R-1a: an equation whose value may be a promise or a stream, which Solid's memo would consume; write `await e` (13 TY-5b) | S-types-1 |
136
137
|`TSnnnn`| S | 13 TY-1: TypeScript's errors over the projection, on `.rx` lines | S-types-1 |
0 commit comments