2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/genericTypeWithCallableMembers.ts ===
|
|
|
|
interface Constructable {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Constructable : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
new (): Constructable;
|
2015-04-16 01:44:20 +02:00
|
|
|
>Constructable : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class C<T extends Constructable> {
|
2015-04-16 01:44:20 +02:00
|
|
|
>C : C<T>
|
|
|
|
>T : T
|
|
|
|
>Constructable : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
constructor(public data: T, public data2: Constructable) { }
|
2015-04-16 01:44:20 +02:00
|
|
|
>data : T
|
|
|
|
>T : T
|
|
|
|
>data2 : Constructable
|
|
|
|
>Constructable : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
create() {
|
2015-04-16 01:44:20 +02:00
|
|
|
>create : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x = new this.data(); // no error
|
2015-04-16 01:44:20 +02:00
|
|
|
>x : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
>new this.data() : Constructable
|
2015-04-16 01:44:20 +02:00
|
|
|
>this.data : T
|
|
|
|
>this : C<T>
|
|
|
|
>data : T
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x2 = new this.data2(); // was error, shouldn't be
|
2015-04-16 01:44:20 +02:00
|
|
|
>x2 : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
>new this.data2() : Constructable
|
2015-04-16 01:44:20 +02:00
|
|
|
>this.data2 : Constructable
|
|
|
|
>this : C<T>
|
|
|
|
>data2 : Constructable
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|