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
Search Terms: generic , intellisense , infered type
Code:
/*This function will be used in javascript projects.I want its intellisense to work in javascript projects.*/functioncomponent<T>(p: {actions : ()=>T,htmlTemplate: <SextendsT>(actions : S)=>any}){returnp;}component({actions : ()=>({a : (x,y)=>x+y}),htmlTemplate : (actions)=>{/*try to dot into the actions and you will get intellisense*/actions;/*but if you dot here you will get no intellisense*/returnactions;/* Intellisense appears in the `return actions` If I type `x` and `y`. Strangely it works if I explicitly type them with `any` but it does not work if I they are implicilty typed with `any` . How can I have no problem with intellisense with implicit `any`? */}})
Expected behavior: Implicit any should have the same effect on intellisense with explicit any .
Actual behavior: Implicit any is different from explicit any .
TypeScript Version: 3.9.2
Search Terms: generic , intellisense , infered type
Code:
Expected behavior: Implicit
any
should have the same effect on intellisense with explicitany
.Actual behavior: Implicit
any
is different from explicitany
.Playground Link: link
The text was updated successfully, but these errors were encountered: