If the author is reading this, the proposed solution to the `merge` challenge is:
function merge(a: A, b: B): A & B {
return { ...a, ...b };
}
That's the "obvious" solution, but it means that the following type-checks: const a: number = 1;
const b: number = 2;
const c: number = merge(a, b);
That's not good. It shouldn't type check because the following: const d: number = { ...a, ...b };
does not type check.And I don't know how to express the correct solution (i.e. where we actually assert that A and B are object types).
Also, looking forward to further chapters.