diff --git a/packages/compiler/test/map-closure-elements.test.ts b/packages/compiler/test/map-closure-elements.test.ts index 2043b2bce..f39281579 100644 --- a/packages/compiler/test/map-closure-elements.test.ts +++ b/packages/compiler/test/map-closure-elements.test.ts @@ -58,7 +58,7 @@ export {}; expect(validateModule(result.module)).toEqual([]); }); -test("a void-returning map callback still has no element to store", async () => { +test("a void-returning map callback stores undefined elements", async () => { const result = await lower(` const items = [1, 2]; const out = items.map((n) => { @@ -67,8 +67,8 @@ const out = items.map((n) => { console.log(out.length); export {}; `); - // `void[]` stays unrepresentable: a void value is erased before it could - // be written. Only the CLOSURE element became an ordinary element. - expect(result.ok).toBe(false); - if (!result.ok) expect(result.codes).toEqual(["SC2009"]); + // A discarding mapper's answer is undefined, which the result array + // stores as its element (as Node's map does). + if (!result.ok) throw new Error(`fenced: ${result.codes.join(", ")}`); + expect(validateModule(result.module)).toEqual([]); }); diff --git a/tests/harness/__snapshots__/record-width.ts.txt b/tests/harness/__snapshots__/record-width.ts.txt index 37be4df54..4c8744a3c 100644 --- a/tests/harness/__snapshots__/record-width.ts.txt +++ b/tests/harness/__snapshots__/record-width.ts.txt @@ -7,15 +7,6 @@ record-width.ts:12:25 - error SC2002: record shapes must match exactly or width- hint: width subtyping compiles as a copy (each expected field copied off the source; extra fields drop) — this pair is outside the copy's rules; build a literal with exactly the expected fields instead -record-width.ts:26:20 - error SC2002: record shapes must match exactly or width-coerce: expected '{ m: ({ a: number; b: number }) => void }', got '{ extra: number; m: ({ a: number }) => void }' — field 'm': '({ a: number }) => void' does not lift into '({ a: number; b: number }) => void' - - 25 | }; - 26 | const dstM: DstM = srcM; - | ^~~~ - 27 | console.log(dstM); - - hint: width subtyping compiles as a copy (each expected field copied off the source; extra fields drop) — this pair is outside the copy's rules; build a literal with exactly the expected fields instead - record-width.ts:27:13 - error SC1090: console.log of '{ m: ({ a: number; b: number }) => void }' values (function values have no inspect lowering (no runtime name exists — Node prints '[Function: name]'; pass the function's declared identifier directly to util.inspect for the baked form)) is not supported yet 26 | const dstM: DstM = srcM;