This the example from docs:

interface Square {
kind: "square";
size: number;
}
interface Rectangle {
kind: "rectangle";
width: number;
height: number;
}
interface Circle {
kind: "circle";
radius: number;
}
type Shape = Square | Rectangle | Circle;
let shape: Shape = {
kind: "square",
width: 10,
height: 10
}
So we create object with type Shape of kind square and try to pass incorrect other props (for this kind), and TS emits the error that object is no assignable to last type that is in union (Circle in this case). I believe it would be better if TS would recoginze that we are trying to make Square type in this case and emitted corresponding error message.
This the example from docs:

So we create object with type
Shapeof kindsquareand try to pass incorrect other props (for this kind), and TS emits the error that object is no assignable to last type that is in union (Circlein this case). I believe it would be better if TS would recoginze that we are trying to makeSquaretype in this case and emitted corresponding error message.