diff --git a/src/tagged-union.test.ts b/src/tagged-union.test.ts index e3e1d26..7873b81 100644 --- a/src/tagged-union.test.ts +++ b/src/tagged-union.test.ts @@ -216,8 +216,22 @@ test("getTaggedUnionMatcherW: boolean and nullish tags widen to the union", () = assert.equal(s.kind, true); return "yes" as const; }, - false: () => 0 as const, - null: () => null, + false: (s) => { + expectTypeOf(s).toEqualTypeOf<{ + readonly kind: false; + readonly b: number; + }>(); + assert.equal(s.kind, false); + return 0 as const; + }, + null: (s) => { + expectTypeOf(s).toEqualTypeOf<{ + readonly kind: null; + readonly c: number; + }>(); + assert.equal(s.kind, null); + return null; + }, }); // Assert