Typescript allows the following, wondering if is this by design? I was thinking it should not be allowed to return
a "wider" Point inside a function that wants to return Omit<Point, 'whatever'>.
interface Point {
x: number,
y: number
}
function getPoint() {
return { x: 3, y: 9 }
}
function ohNo(): Omit<Point, 'y'> {
// is allowing this to compile "by design"?
return getPoint()
}
const p = ohNo()
console.log('oh no', p)
Playground link here