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
This may be a duplicate of #7234 and/or #3812, but I don't know enough about the internals of TypeScript to know for sure. Let's say I have the following:
interfaceMyInfo<T>{data: T;}classFoo{x: number;}letfooInfos: MyInfo<Foo>[];letobjectInfos: MyInfo<Object>[];for(letinfoofobjectInfos){if(info.datainstanceofFoo){fooInfos.push(info);// should infer that info is MyInfo<Foo>, but it doesn't}}
In this case, the compiler still thinks info is of type MyInfo<Object> instead of MyInfo<Foo>, whereas I would expect it to be able to properly infer the type.
The text was updated successfully, but these errors were encountered:
This may be a duplicate of #7234 and/or #3812, but I don't know enough about the internals of TypeScript to know for sure. Let's say I have the following:
In this case, the compiler still thinks
info
is of typeMyInfo<Object>
instead ofMyInfo<Foo>
, whereas I would expect it to be able to properly infer the type.The text was updated successfully, but these errors were encountered: