|
| 1 | +=== tests/cases/conformance/types/thisType/declarationFiles.ts === |
| 2 | + |
| 3 | +class C1 { |
| 4 | +>C1 : Symbol(C1, Decl(declarationFiles.ts, 0, 0)) |
| 5 | + |
| 6 | + x: this; |
| 7 | +>x : Symbol(x, Decl(declarationFiles.ts, 1, 10)) |
| 8 | + |
| 9 | + f(x: this): this { return undefined; } |
| 10 | +>f : Symbol(f, Decl(declarationFiles.ts, 2, 12)) |
| 11 | +>x : Symbol(x, Decl(declarationFiles.ts, 3, 6)) |
| 12 | +>undefined : Symbol(undefined) |
| 13 | + |
| 14 | + constructor(x: this) { } |
| 15 | +>x : Symbol(x, Decl(declarationFiles.ts, 4, 16)) |
| 16 | +} |
| 17 | + |
| 18 | +class C2 { |
| 19 | +>C2 : Symbol(C2, Decl(declarationFiles.ts, 5, 1)) |
| 20 | + |
| 21 | + [x: string]: this; |
| 22 | +>x : Symbol(x, Decl(declarationFiles.ts, 8, 5)) |
| 23 | +} |
| 24 | + |
| 25 | +interface Foo<T> { |
| 26 | +>Foo : Symbol(Foo, Decl(declarationFiles.ts, 9, 1)) |
| 27 | +>T : Symbol(T, Decl(declarationFiles.ts, 11, 14)) |
| 28 | + |
| 29 | + x: T; |
| 30 | +>x : Symbol(x, Decl(declarationFiles.ts, 11, 18)) |
| 31 | +>T : Symbol(T, Decl(declarationFiles.ts, 11, 14)) |
| 32 | + |
| 33 | + y: this; |
| 34 | +>y : Symbol(y, Decl(declarationFiles.ts, 12, 9)) |
| 35 | +} |
| 36 | + |
| 37 | +class C3 { |
| 38 | +>C3 : Symbol(C3, Decl(declarationFiles.ts, 14, 1)) |
| 39 | + |
| 40 | + a: this[]; |
| 41 | +>a : Symbol(a, Decl(declarationFiles.ts, 16, 10)) |
| 42 | + |
| 43 | + b: [this, this]; |
| 44 | +>b : Symbol(b, Decl(declarationFiles.ts, 17, 14)) |
| 45 | + |
| 46 | + c: this | Date; |
| 47 | +>c : Symbol(c, Decl(declarationFiles.ts, 18, 20)) |
| 48 | +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) |
| 49 | + |
| 50 | + d: this & Date; |
| 51 | +>d : Symbol(d, Decl(declarationFiles.ts, 19, 19)) |
| 52 | +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) |
| 53 | + |
| 54 | + e: (((this))); |
| 55 | +>e : Symbol(e, Decl(declarationFiles.ts, 20, 19)) |
| 56 | + |
| 57 | + f: (x: this) => this; |
| 58 | +>f : Symbol(f, Decl(declarationFiles.ts, 21, 18)) |
| 59 | +>x : Symbol(x, Decl(declarationFiles.ts, 22, 8)) |
| 60 | + |
| 61 | + g: new (x: this) => this; |
| 62 | +>g : Symbol(g, Decl(declarationFiles.ts, 22, 25)) |
| 63 | +>x : Symbol(x, Decl(declarationFiles.ts, 23, 12)) |
| 64 | + |
| 65 | + h: Foo<this>; |
| 66 | +>h : Symbol(h, Decl(declarationFiles.ts, 23, 29)) |
| 67 | +>Foo : Symbol(Foo, Decl(declarationFiles.ts, 9, 1)) |
| 68 | + |
| 69 | + i: Foo<this | (() => this)>; |
| 70 | +>i : Symbol(i, Decl(declarationFiles.ts, 24, 17)) |
| 71 | +>Foo : Symbol(Foo, Decl(declarationFiles.ts, 9, 1)) |
| 72 | + |
| 73 | + j: (x: any) => x is this; |
| 74 | +>j : Symbol(j, Decl(declarationFiles.ts, 25, 32)) |
| 75 | +>x : Symbol(x, Decl(declarationFiles.ts, 26, 8)) |
| 76 | +>x : Symbol(x, Decl(declarationFiles.ts, 26, 8)) |
| 77 | +} |
| 78 | + |
| 79 | +class C4 { |
| 80 | +>C4 : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 81 | + |
| 82 | + x1 = { a: this }; |
| 83 | +>x1 : Symbol(x1, Decl(declarationFiles.ts, 29, 10)) |
| 84 | +>a : Symbol(a, Decl(declarationFiles.ts, 30, 10)) |
| 85 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 86 | + |
| 87 | + x2 = [this]; |
| 88 | +>x2 : Symbol(x2, Decl(declarationFiles.ts, 30, 21)) |
| 89 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 90 | + |
| 91 | + x3 = [{ a: this }]; |
| 92 | +>x3 : Symbol(x3, Decl(declarationFiles.ts, 31, 16)) |
| 93 | +>a : Symbol(a, Decl(declarationFiles.ts, 32, 11)) |
| 94 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 95 | + |
| 96 | + x4 = () => this; |
| 97 | +>x4 : Symbol(x4, Decl(declarationFiles.ts, 32, 23)) |
| 98 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 99 | + |
| 100 | + f1() { |
| 101 | +>f1 : Symbol(f1, Decl(declarationFiles.ts, 33, 20)) |
| 102 | + |
| 103 | + return { a: this }; |
| 104 | +>a : Symbol(a, Decl(declarationFiles.ts, 35, 16)) |
| 105 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 106 | + } |
| 107 | + f2() { |
| 108 | +>f2 : Symbol(f2, Decl(declarationFiles.ts, 36, 5)) |
| 109 | + |
| 110 | + return [this]; |
| 111 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 112 | + } |
| 113 | + f3() { |
| 114 | +>f3 : Symbol(f3, Decl(declarationFiles.ts, 39, 5)) |
| 115 | + |
| 116 | + return [{ a: this }]; |
| 117 | +>a : Symbol(a, Decl(declarationFiles.ts, 41, 17)) |
| 118 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 119 | + } |
| 120 | + f4() { |
| 121 | +>f4 : Symbol(f4, Decl(declarationFiles.ts, 42, 5)) |
| 122 | + |
| 123 | + return () => this; |
| 124 | +>this : Symbol(C4, Decl(declarationFiles.ts, 27, 1)) |
| 125 | + } |
| 126 | +} |
| 127 | + |
0 commit comments