2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/inheritanceOfGenericConstructorMethod1.ts ===
|
|
|
|
class A<T> { }
|
|
|
|
>A : A<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
class B<T> extends A<T> {}
|
|
|
|
>B : B<T>
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>A : A<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>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>
|
2014-08-19 04:56:03 +02:00
|
|
|
>B : B<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>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
|
|
|
|
|