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
Expected behavior:
no error Actual behavior:
line interface B<T> extends _A<T> { } is error // TS2312: An interface may only extend a class or another interface.
Now, we can deriving from object and intersection types by #13604.
But this is only for _A<T> is statically composed of object or intersection types.
I think we can solve this problem if we can delay type evaluation until actual type resolution at the line type TypedPerson = B<Person>;
or, we need generics type restriction like below?
interface B<T is interface> extends _A<T> { }
The text was updated successfully, but these errors were encountered:
the T is unknown. it would have been fine to extend from _A<{}>, but not from T. The reason is the compiler does not know what T is at the declaration site, and thus does not know how to check the extends relationship in the interface declaration.
TypeScript Version: nightly (2.2.0-dev.20170128)
Code
Expected behavior:
no error
Actual behavior:
line
interface B<T> extends _A<T> { }
is error// TS2312: An interface may only extend a class or another interface.
Now, we can deriving from object and intersection types by #13604.
But this is only for
_A<T>
is statically composed of object or intersection types.I think we can solve this problem if we can delay type evaluation until actual type resolution at the line
type TypedPerson = B<Person>;
or, we need generics type restriction like below?
The text was updated successfully, but these errors were encountered: