36 lines
648 B
Text
36 lines
648 B
Text
=== tests/cases/compiler/inheritanceOfGenericConstructorMethod1.ts ===
|
|
class A<T> { }
|
|
>A : A<T>
|
|
>T : T
|
|
|
|
class B<T> extends A<T> {}
|
|
>B : B<T>
|
|
>T : T
|
|
>A : A<T>
|
|
>T : T
|
|
|
|
var a = new A<Date>();
|
|
>a : A<Date>
|
|
>new A<Date>() : A<Date>
|
|
>A : typeof A
|
|
>Date : Date
|
|
|
|
var b1 = new B(); // no error
|
|
>b1 : B<{}>
|
|
>new B() : B<{}>
|
|
>B : typeof B
|
|
|
|
var b2: B<Date> = new B<Date>(); // no error
|
|
>b2 : B<Date>
|
|
>B : B<T>
|
|
>Date : Date
|
|
>new B<Date>() : B<Date>
|
|
>B : typeof B
|
|
>Date : Date
|
|
|
|
var b3 = new B<Date>(); // error, could not select overload for 'new' expression
|
|
>b3 : B<Date>
|
|
>new B<Date>() : B<Date>
|
|
>B : typeof B
|
|
>Date : Date
|
|
|