Skip to content

Commit 81934ab

Browse files
committed
Accepting new baselines
1 parent 24f906a commit 81934ab

4 files changed

Lines changed: 67 additions & 268 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
tests/cases/conformance/types/thisType/declarationFiles.ts(31,5): error TS2527: The inferred type of 'x1' references an inaccessible 'this' type. A type annotation is necessary.
2+
tests/cases/conformance/types/thisType/declarationFiles.ts(33,5): error TS2527: The inferred type of 'x3' references an inaccessible 'this' type. A type annotation is necessary.
3+
tests/cases/conformance/types/thisType/declarationFiles.ts(35,5): error TS2527: The inferred type of 'f1' references an inaccessible 'this' type. A type annotation is necessary.
4+
tests/cases/conformance/types/thisType/declarationFiles.ts(41,5): error TS2527: The inferred type of 'f3' references an inaccessible 'this' type. A type annotation is necessary.
5+
6+
7+
==== tests/cases/conformance/types/thisType/declarationFiles.ts (4 errors) ====
8+
9+
class C1 {
10+
x: this;
11+
f(x: this): this { return undefined; }
12+
constructor(x: this) { }
13+
}
14+
15+
class C2 {
16+
[x: string]: this;
17+
}
18+
19+
interface Foo<T> {
20+
x: T;
21+
y: this;
22+
}
23+
24+
class C3 {
25+
a: this[];
26+
b: [this, this];
27+
c: this | Date;
28+
d: this & Date;
29+
e: (((this)));
30+
f: (x: this) => this;
31+
g: new (x: this) => this;
32+
h: Foo<this>;
33+
i: Foo<this | (() => this)>;
34+
j: (x: any) => x is this;
35+
}
36+
37+
class C4 {
38+
x1 = { a: this };
39+
~~
40+
!!! error TS2527: The inferred type of 'x1' references an inaccessible 'this' type. A type annotation is necessary.
41+
x2 = [this];
42+
x3 = [{ a: this }];
43+
~~
44+
!!! error TS2527: The inferred type of 'x3' references an inaccessible 'this' type. A type annotation is necessary.
45+
x4 = () => this;
46+
f1() {
47+
~~
48+
!!! error TS2527: The inferred type of 'f1' references an inaccessible 'this' type. A type annotation is necessary.
49+
return { a: this };
50+
}
51+
f2() {
52+
return [this];
53+
}
54+
f3() {
55+
~~
56+
!!! error TS2527: The inferred type of 'f3' references an inaccessible 'this' type. A type annotation is necessary.
57+
return [{ a: this }];
58+
}
59+
f4() {
60+
return () => this;
61+
}
62+
}
63+

tests/baselines/reference/declarationFiles.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@ declare class C3 {
117117
}
118118
declare class C4 {
119119
x1: {
120-
a: C4;
120+
a: this;
121121
};
122122
x2: this[];
123123
x3: {
124-
a: C4;
124+
a: this;
125125
}[];
126126
x4: () => this;
127127
f1(): {
128-
a: C4;
128+
a: this;
129129
};
130130
f2(): this[];
131131
f3(): {
132-
a: C4;
132+
a: this;
133133
}[];
134134
f4(): () => this;
135135
}

tests/baselines/reference/declarationFiles.symbols

Lines changed: 0 additions & 127 deletions
This file was deleted.

tests/baselines/reference/declarationFiles.types

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)