Stefan Baumgartner 7/21/2021

TypeScript: Unexpected intersections

Read Original

This 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.

TypeScript: Unexpected intersections

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet