DEV Community

Row Polymorphic Records for More Type Safety in Typescript

Iven Marquardt on April 20, 2020

Typescript's type system uses structural subtyping and hence allows every data structure for a given type that contains at least the demanded prope...
Collapse
 
allforabit profile image
allforabit

I can't quite see why the second example doesn't type check?

Collapse
 
allforabit profile image
allforabit

Oh now I see it, both T's have to be the same shape.