You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionflatMap<ItemType,ProjectedItemType>(projectorFn: (item: ItemType)=>ProjectedItemType[]): (aggregate: ProjectedItemType[],item: ItemType)=>ProjectedItemType[]{return(aggregate: ProjectedItemType[],current: ItemType)=>aggregate.concat(projectorFn(current)||[]);}['alice','bob'].reduce(flatMap(name=>name.split('')),[]);['alice','bob'].reduce(flatMap<string,string>(name=>name.split('')),[]);// this works fine
Expected behavior:
TypeScript compiler should infer that type of name is string.
Actual behavior:
Compiler error: Property 'split' does not exist on type '{}'.
TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
Expected behavior:
TypeScript compiler should infer that type of
nameisstring.Actual behavior:
Compiler error:
Property 'split' does not exist on type '{}'.