fix: [Symbol.iterator]() lost on union with never (#62661)

This commit is contained in:
Nico Rainhart
2025-11-10 20:11:13 -03:00
committed by GitHub
parent efca03ffed
commit 48244d89f8
7 changed files with 539 additions and 0 deletions

View File

@@ -45842,6 +45842,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
* the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method.
*/
function getIterationTypesOfIterable(type: Type, use: IterationUse, errorNode: Node | undefined) {
type = getReducedType(type);
if (type === silentNeverType) {
return silentNeverIterationTypes;
}