**Search Terms:** Intl NumberFormatPartsType **Code** ```ts const formatter = new Intl.NumberFormat('en', {style: 'unit', unit: 'kilobyte'}); return formatter.formatToParts(0).find(part => part.type === 'unit').value; ``` **Expected behavior:** Compiles cleanly. See, for example, [this MDN doc for Intl.formatByParts()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts) which lists "unit" as a possible part type **Actual behavior:** tsc throws an error: This condition will always return 'false' since the types 'NumberFormatPartTypes' and '"unit"' have no overlap. **Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> https://www.typescriptlang.org/play?target=99&ts=4.2.0-dev.20201211#code/KYDwDg9gTgLgBAMwK4DsDGMCWEVwLYCGA1sAKoqYwBi0hMMwUAFKpQFxwDOMUmKA5gBo4AGwICkBfsA7deAgJRwA3gCg4cKMBhIouFMADucAJIoYIgHQA5JHgBGjGlDpMxEqcGHLuATxEycADkrDBBwqEAvgoA3KqRqqqgkLCIqBjYuAi0BPTAACbklCwUMLI8fEKi4vyS0uXy-EpqGmg43Ig5eVBwALz4xGSlznQMzKHC7rWeseqa2rpZXWOW2S65ACoQAAoEsJxMAAwKq3z5TExge-C9AHxwV7CWML5gwH29-SGlQQonAG4EERIYBxSJAA **Related Issues:** <!-- Did you find other bugs that looked similar? -->
Search Terms:
Intl
NumberFormatPartsType
Code
Expected behavior:
Compiles cleanly. See, for example, this MDN doc for Intl.formatByParts() which lists "unit" as a possible part type
Actual behavior:
tsc throws an error: This condition will always return 'false' since the types 'NumberFormatPartTypes' and '"unit"' have no overlap.
Playground Link:
https://www.typescriptlang.org/play?target=99&ts=4.2.0-dev.20201211#code/KYDwDg9gTgLgBAMwK4DsDGMCWEVwLYCGA1sAKoqYwBi0hMMwUAFKpQFxwDOMUmKA5gBo4AGwICkBfsA7deAgJRwA3gCg4cKMBhIouFMADucAJIoYIgHQA5JHgBGjGlDpMxEqcGHLuATxEycADkrDBBwqEAvgoA3KqRqqqgkLCIqBjYuAi0BPTAACbklCwUMLI8fEKi4vyS0uXy-EpqGmg43Ig5eVBwALz4xGSlznQMzKHC7rWeseqa2rpZXWOW2S65ACoQAAoEsJxMAAwKq3z5TExge-C9AHxwV7CWML5gwH29-SGlQQonAG4EERIYBxSJAA
Related Issues: