import { expectType } from "tsd" ; { const arr = [ 1 , 2 , 3 ] ; const n = arr [ Symbol . iterator ] ( ) . next ( ) ; if ( n . done ) { expectType < undefined > ( n . value ) ; } else { expectType < number > ( n . value ) ; } } { ( function ( ) { for ( const v of arguments ) { expectType < unknown > ( v ) ; } } ) ( ) ; } { const map = new Map ( [ [ 1 , 1 ] , [ 2 , 3 ] , [ 3 , 6 ] , ] ) ; const n = map [ Symbol . iterator ] ( ) . next ( ) ; if ( n . done ) { expectType < undefined > ( n . value ) ; } else { expectType < [ number , number ] > ( n . value ) ; } } { const map = new Map ( ) ; const n = map [ Symbol . iterator ] ( ) . next ( ) ; if ( n . done ) { expectType < undefined > ( n . value ) ; } else { expectType < [ number , number ] > ( n . value ) ; } } { const set = new Set ( [ 1 , 2 , 3 ] ) ; const n = set [ Symbol . iterator ] ( ) . next ( ) ; if ( n . done ) { expectType < undefined > ( n . value ) ; } else { expectType < number > ( n . value ) ; } } { const set = new Set ( ) ; const n = set [ Symbol . iterator ] ( ) . next ( ) ; if ( n . done ) { expectType < undefined > ( n . value ) ; } else { expectType < number > ( n . value ) ; } } { const it = [ ] ; const w = await Promise . all ( it ) ; expectType < ( string | number ) [ ] > ( w ) ; const w2 = await Promise . race ( it ) ; expectType < string | number > ( w2 ) ; }