Closed
Description
When casting from a type A to a type B, the spec says that either A is assignable to B, or B is assignable to A. But the playground allows something more general: in some cases, as long as A and B have a common subtype, it doesn’t warn. The next example is valid.
function f(x: number | string) {
return <number | boolean>(x);
}
The playground uses the comparable relation. The spec should be updated to include it.