TypeScript/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types

56 lines
964 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/inheritanceOfGenericConstructorMethod2.ts ===
module M {
2014-08-28 21:40:58 +02:00
>M : typeof M
2014-08-15 23:33:16 +02:00
export class C1 { }
>C1 : C1
export class C2<T> { }
>C2 : C2<T>
>T : T
}
module N {
2014-08-28 21:40:58 +02:00
>N : typeof N
2014-08-15 23:33:16 +02:00
export class D1 extends M.C1 { }
>D1 : D1
2014-08-28 21:40:58 +02:00
>M : unknown
2014-08-25 19:36:12 +02:00
>C1 : M.C1
2014-08-15 23:33:16 +02:00
export class D2<T> extends M.C2<T> { }
>D2 : D2<T>
>T : T
2014-08-28 21:40:58 +02:00
>M : unknown
2014-08-25 19:36:12 +02:00
>C2 : M.C2<T>
2014-08-15 23:33:16 +02:00
>T : T
}
var c = new M.C2<number>(); // no error
2014-08-25 19:36:12 +02:00
>c : M.C2<number>
>new M.C2<number>() : M.C2<number>
>M.C2 : typeof M.C2
2014-08-15 23:33:16 +02:00
>M : typeof M
2014-08-25 19:36:12 +02:00
>C2 : typeof M.C2
2014-08-15 23:33:16 +02:00
var n = new N.D1(); // no error
2014-08-25 19:36:12 +02:00
>n : N.D1
>new N.D1() : N.D1
>N.D1 : typeof N.D1
2014-08-15 23:33:16 +02:00
>N : typeof N
2014-08-25 19:36:12 +02:00
>D1 : typeof N.D1
2014-08-15 23:33:16 +02:00
var n2 = new N.D2<number>(); // error
2014-08-25 19:36:12 +02:00
>n2 : N.D2<number>
>new N.D2<number>() : N.D2<number>
>N.D2 : typeof N.D2
2014-08-15 23:33:16 +02:00
>N : typeof N
2014-08-25 19:36:12 +02:00
>D2 : typeof N.D2
2014-08-15 23:33:16 +02:00
var n3 = new N.D2(); // no error, D2<any>
2014-08-25 19:36:12 +02:00
>n3 : N.D2<{}>
>new N.D2() : N.D2<{}>
>N.D2 : typeof N.D2
2014-08-15 23:33:16 +02:00
>N : typeof N
2014-08-25 19:36:12 +02:00
>D2 : typeof N.D2
2014-08-15 23:33:16 +02:00