1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
=== tests/cases/conformance/types/thisType/thisTypeAndConstraints.ts ===
class A {
>A : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0))
self() {
>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
return this;
>this : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0))
}
}
function f<T extends A>(x: T) {
>f : Symbol(f, Decl(thisTypeAndConstraints.ts, 4, 1))
>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 6, 11))
>A : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 6, 24))
>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 6, 11))
function g<U extends T>(x: U) {
>g : Symbol(g, Decl(thisTypeAndConstraints.ts, 6, 31))
>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 7, 15))
>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 6, 11))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 7, 28))
>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 7, 15))
x = x.self();
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 7, 28))
>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 7, 28))
>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
}
x = x.self();
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 6, 24))
>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 6, 24))
>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
}
class B<T extends A> {
>B : Symbol(B, Decl(thisTypeAndConstraints.ts, 11, 1))
>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 13, 8))
>A : Symbol(A, Decl(thisTypeAndConstraints.ts, 0, 0))
foo(x: T) {
>foo : Symbol(B.foo, Decl(thisTypeAndConstraints.ts, 13, 22))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 14, 8))
>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 13, 8))
x = x.self();
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 14, 8))
>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 14, 8))
>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
}
bar<U extends T>(x: U) {
>bar : Symbol(B.bar, Decl(thisTypeAndConstraints.ts, 16, 5))
>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 17, 8))
>T : Symbol(T, Decl(thisTypeAndConstraints.ts, 13, 8))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 17, 21))
>U : Symbol(U, Decl(thisTypeAndConstraints.ts, 17, 8))
x = x.self();
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 17, 21))
>x.self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
>x : Symbol(x, Decl(thisTypeAndConstraints.ts, 17, 21))
>self : Symbol(A.self, Decl(thisTypeAndConstraints.ts, 0, 9))
}
}
|