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
Array filter have possibly wrong signature or 4.8 introduced "Unconstrained Generics No Longer Assignable to {}" introduced type error
π Search Terms
π Version & Regression Information
After the update to 4.8.2
β― Playground Link
Playground - long cause copy some angular types for perfect reproduction - actual code on the end of code
π» Code
exportconstserializeParams=<Textends{}>(query: T): HttpParams=>{returnnewHttpParams().appendAll(Object.fromEntries(Object.entries(query)))};exportconstserializeParams2=<Textends{}>(query: T): HttpParams=>{returnnewHttpParams().appendAll(Object.fromEntries(Object.entries(query).filter(val=>val[1]!==undefined)))};exportconstserializeParams3=<Textends{}>(query: T): HttpParams=>{returnnewHttpParams().appendAll(Object.fromEntries(Object.entries(query).filter(([_,value])=>value!==undefined).map(([key,value])=>{if(typeofvalue==='object'&&value!==null&&!Array.isArray(value)){return[key,JSON.stringify(value)];}else{return[key,value??''];}})));};exportconstserializeParams4=<Textends{}>(query: T): HttpParams=>{constentries=Object.entries(query).filter(([_,value])=>value!==undefined).map(([key,value])=>{if(typeofvalue==='object'&&value!==null&&!Array.isArray(value)){return[key,JSON.stringify(value)];}else{return[key,value??''];}});returnnewHttpParams().appendAll(Object.fromEntries(entries));// here very weird - moving body to separate const fixes type error in VS code but build still fails with error};
Martin Johns (@MartinJohns) Yes, I can confirm that. All the versions I tried raise the same error. I didn't agree with the OP either. (I am just a passer-by.)
Activity
jcalz commentedon Aug 31, 2022
This should probably be replaced with a list of terms people can search for to find this issue and related issues.
RyanCavanaugh commentedon Aug 31, 2022
I'm not seeing a difference between 4.7 and 4.8 in the Playground link here. Regardless, we'd need a shorter repro to be able to investigate this
kbrilla commentedon Sep 1, 2022
I'm working on clearer and shorter reproduction, will try to post it today
graphemecluster commentedon Sep 1, 2022
What the OP mean is:
MartinJohns commentedon Sep 1, 2022
graphemecluster (@graphemecluster) How is that an regression in 4.8? It's the same error in the last few versions.
graphemecluster commentedon Sep 1, 2022
Martin Johns (@MartinJohns) Yes, I can confirm that. All the versions I tried raise the same error. I didn't agree with the OP either. (I am just a passer-by.)