36 lines
1.6 KiB
Text
36 lines
1.6 KiB
Text
=== tests/cases/compiler/genericTypeWithCallableMembers.ts ===
|
|
interface Constructable {
|
|
>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0))
|
|
|
|
new (): Constructable;
|
|
>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0))
|
|
}
|
|
|
|
class C<T extends Constructable> {
|
|
>C : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1))
|
|
>T : Symbol(T, Decl(genericTypeWithCallableMembers.ts, 4, 8))
|
|
>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0))
|
|
|
|
constructor(public data: T, public data2: Constructable) { }
|
|
>data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16))
|
|
>T : Symbol(T, Decl(genericTypeWithCallableMembers.ts, 4, 8))
|
|
>data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31))
|
|
>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0))
|
|
|
|
create() {
|
|
>create : Symbol(create, Decl(genericTypeWithCallableMembers.ts, 5, 64))
|
|
|
|
var x = new this.data(); // no error
|
|
>x : Symbol(x, Decl(genericTypeWithCallableMembers.ts, 7, 11))
|
|
>this.data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16))
|
|
>this : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1))
|
|
>data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16))
|
|
|
|
var x2 = new this.data2(); // was error, shouldn't be
|
|
>x2 : Symbol(x2, Decl(genericTypeWithCallableMembers.ts, 8, 11))
|
|
>this.data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31))
|
|
>this : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1))
|
|
>data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31))
|
|
}
|
|
}
|
|
|