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
interfaceA<T>{t: T}functionf<TextendsA<any>>(t: T['t']): T{return{ t };}
Here t is of type any instead of T['t']. So I suppose that what's going on is that T['t'] is evaluated immediately instead of keeping the generic value.
So my question would be: Will the type system ever support this behaviour?
The issue is fixed by #12770, but note that your example only works if you remove the private modifier from t because indexed access types only operate on public properties.
TypeScript Version: 2.1.4
Code
Expected behavior:
I would expect that the type of
D.b
would bestring
.Actual behavior:
Type of
D.b
isany
The text was updated successfully, but these errors were encountered: