79073919

Date: 2024-10-10 10:23:01
Score: 1
Natty:
Report link

I found this:

type MergeSubtypes<T, U = T> = T extends U
  ? Exclude<U, T> extends infer Rest
    ? T extends Rest
      ? never
      : T
    : never
  : never;

And it does seem to work, but maybe someone can still explain the core reason.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Janek Eilts