Closed
Description
TypeScript Version: nightly (2.2.0-dev.20170128)
Code
interface Person{
name: string;
}
interface A<T> {
}
type _A<T> = A<T> & T;
interface B<T> extends _A<T> { }
type TypedPerson = B<Person>;
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> { }