TypeScript: Unexpected intersections
Read OriginalThis article delves into a common TypeScript puzzle where assigning values to object properties via index access types causes the error 'Type is not assignable to never'. It explains how TypeScript uses intersection types to find the lowest common denominator of possible values, leading to this counter-intuitive behavior, and provides illustrative code examples.
Comments
No comments yet
Be the first to share your thoughts!
Top of the Week
No top articles yet