TypeScript Version: nightly (2.2.0-dev.20170128)
Code
interfacePerson{name: string;}interfaceA<T>{}type_A<T>=A<T>&T;interfaceB<T>extends_A<T>{}typeTypedPerson=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> { }
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?