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
typePolygon=string[][]|string[][][];constp1: Polygon=[['1','1'],['2','2'],['3','1'],['1','1']];constp2: Polygon=[[['1','1'],['2','2'],['3','1'],['1','1']],[['2','2'],['2.4','2.4'],['3.1']]];p1.every(console.log);// it works. No complains.p2.every(console.log);// it works. No complains.constfn=(polygon: Polygon): void=>{// .every complains with "this expression is not callable"if(polygon.every((p)=>p.length===2)){//}};
It's working consistently. Your two variables are not actually typed Polygon because the assignment narrows the type. When you add an as Polygon behind your assignment it won't narrow and the behavior is the same.
Bug Report
array.every
on unionstring[][] | string[][][];
throws aThis expression is not callable.
.π Search Terms
array.every not callable
.every not callable
every not callable
π Version & Regression Information
TS 4.9
β― Playground Link
Repro here on TS Playground
π» Code
π Actual behavior
TS throws an error.
π Expected behavior
TS should not throw an error.
CC: @emilioSp
The text was updated successfully, but these errors were encountered: