this post was submitted on 10 Dec 2023
6 points (75.0% liked)

TypeScript

844 readers
1 users here now

founded 2 years ago
MODERATORS
 
top 3 comments
sorted by: hot top controversial new old
[–] towerful 3 points 1 year ago* (last edited 1 year ago) (1 children)

I presume the details of this post got lost somewhere?

let x = () => ({ name: "Alice" });
let y = () => ({ name: "Alice", location: "Seattle" });
x = y; // OK
y = x; // Error, because x() lacks a location property`

https://www.typescriptlang.org/docs/handbook/type-compatibility.html

There doesn't seem to be an article directly on subtypes

[–] [email protected] 4 points 1 year ago

Typescript error in Post. Was expecting argument of type Link, received undefined.

[–] [email protected] 1 points 1 year ago