function getX(num: 1|2) { if (num === 1) return 'aaa'; if (num === 2) return 100; throw new Error('Wrong num'); } const x = getX(1); // ??
x