Spot the bug in the UserId predicate

from Branded types
TypeScript 6 advanced 4 min 1 issue to find

Find the false proof in this generated UserId predicate.

TypeScript
declare const brandKey: unique symbol;
type UserId = number & { readonly [brandKey]: "UserId" };

function isUserId(value: unknown): value is UserId {
  return typeof value === "number";
}

const input: unknown = JSON.parse("-2");
if (isUserId(input)) {
  console.log(`loading user ${input}`);
}
Open in playground
Report an error