Skip to content

Commit 8600fef

Browse files
committed
Accepting new baselines
1 parent a133684 commit 8600fef

7 files changed

+93
-403
lines changed

tests/baselines/reference/implicitAnyFromCircularInference.errors.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/cases/compiler/implicitAnyFromCircularInference.ts(3,5): error TS7021: 'a' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.
2-
tests/cases/compiler/implicitAnyFromCircularInference.ts(7,5): error TS7021: 'c' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.
3-
tests/cases/compiler/implicitAnyFromCircularInference.ts(10,5): error TS7021: 'd' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.
1+
tests/cases/compiler/implicitAnyFromCircularInference.ts(3,5): error TS2502: 'a' is referenced directly or indirectly in its own type annotation.
2+
tests/cases/compiler/implicitAnyFromCircularInference.ts(7,5): error TS2502: 'c' is referenced directly or indirectly in its own type annotation.
3+
tests/cases/compiler/implicitAnyFromCircularInference.ts(10,5): error TS2502: 'd' is referenced directly or indirectly in its own type annotation.
44
tests/cases/compiler/implicitAnyFromCircularInference.ts(15,10): error TS7023: 'g' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
55
tests/cases/compiler/implicitAnyFromCircularInference.ts(18,10): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
66
tests/cases/compiler/implicitAnyFromCircularInference.ts(23,10): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
@@ -14,18 +14,18 @@ tests/cases/compiler/implicitAnyFromCircularInference.ts(46,5): error TS7023: 'x
1414
// Error expected
1515
var a: typeof a;
1616
~
17-
!!! error TS7021: 'a' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.
17+
!!! error TS2502: 'a' is referenced directly or indirectly in its own type annotation.
1818

1919
// Error expected on b or c
2020
var b: typeof c;
2121
var c: typeof b;
2222
~
23-
!!! error TS7021: 'c' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.
23+
!!! error TS2502: 'c' is referenced directly or indirectly in its own type annotation.
2424

2525
// Error expected
2626
var d: Array<typeof d>;
2727
~
28-
!!! error TS7021: 'd' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation.
28+
!!! error TS2502: 'd' is referenced directly or indirectly in its own type annotation.
2929

3030
function f() { return f; }
3131

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(2,5): error TS2502: 'c' is referenced directly or indirectly in its own type annotation.
2+
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(6,5): error TS2502: 'e' is referenced directly or indirectly in its own type annotation.
3+
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(10,5): error TS2502: 'f' is referenced directly or indirectly in its own type annotation.
4+
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(12,5): error TS2502: 'f2' is referenced directly or indirectly in its own type annotation.
5+
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(14,5): error TS2502: 'f3' is referenced directly or indirectly in its own type annotation.
6+
tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(51,5): error TS2502: 'hy3' is referenced directly or indirectly in its own type annotation.
7+
8+
9+
==== tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts (6 errors) ====
10+
// The following are errors because of circular references
11+
var c: typeof c;
12+
~
13+
!!! error TS2502: 'c' is referenced directly or indirectly in its own type annotation.
14+
var c: any;
15+
var d: typeof e;
16+
var d: any;
17+
var e: typeof d;
18+
~
19+
!!! error TS2502: 'e' is referenced directly or indirectly in its own type annotation.
20+
var e: any;
21+
22+
interface Foo<T> { }
23+
var f: Array<typeof f>;
24+
~
25+
!!! error TS2502: 'f' is referenced directly or indirectly in its own type annotation.
26+
var f: any;
27+
var f2: Foo<typeof f2>;
28+
~~
29+
!!! error TS2502: 'f2' is referenced directly or indirectly in its own type annotation.
30+
var f2: any;
31+
var f3: Foo<typeof f3>[];
32+
~~
33+
!!! error TS2502: 'f3' is referenced directly or indirectly in its own type annotation.
34+
var f3: any;
35+
36+
// None of these declarations should have any errors!
37+
// Truly recursive types
38+
var g: { x: typeof g; };
39+
var g: typeof g.x;
40+
var h: () => typeof h;
41+
var h = h();
42+
var i: (x: typeof i) => typeof x;
43+
var i = i(i);
44+
var j: <T extends typeof j>(x: T) => T;
45+
var j = j(j);
46+
47+
// Same as h, i, j with construct signatures
48+
var h2: new () => typeof h2;
49+
var h2 = new h2();
50+
var i2: new (x: typeof i2) => typeof x;
51+
var i2 = new i2(i2);
52+
var j2: new <T extends typeof j2>(x: T) => T;
53+
var j2 = new j2(j2);
54+
55+
// Indexers
56+
var k: { [n: number]: typeof k;[s: string]: typeof k };
57+
var k = k[0];
58+
var k = k[''];
59+
60+
// Hybrid - contains type literals as well as type arguments
61+
// These two are recursive
62+
var hy1: { x: typeof hy1 }[];
63+
var hy1 = hy1[0].x;
64+
var hy2: { x: Array<typeof hy2> };
65+
var hy2 = hy2.x[0];
66+
67+
interface Foo2<T, U> { }
68+
69+
// This one should be an error because the first type argument is not contained inside a type literal
70+
var hy3: Foo2<typeof hy3, { x: typeof hy3 }>;
71+
~~~
72+
!!! error TS2502: 'hy3' is referenced directly or indirectly in its own type annotation.
73+
var hy3: any;

tests/baselines/reference/recursiveTypesWithTypeof.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
//// [recursiveTypesWithTypeof.ts]
2-
// None of these declarations should have any errors!
3-
// Using typeof directly, these should be any
2+
// The following are errors because of circular references
43
var c: typeof c;
54
var c: any;
65
var d: typeof e;
76
var d: any;
87
var e: typeof d;
98
var e: any;
109

11-
// In type arguments, these should be any
1210
interface Foo<T> { }
1311
var f: Array<typeof f>;
1412
var f: any;
@@ -17,6 +15,7 @@ var f2: any;
1715
var f3: Foo<typeof f3>[];
1816
var f3: any;
1917

18+
// None of these declarations should have any errors!
2019
// Truly recursive types
2120
var g: { x: typeof g; };
2221
var g: typeof g.x;
@@ -49,13 +48,12 @@ var hy2 = hy2.x[0];
4948

5049
interface Foo2<T, U> { }
5150

52-
// This one should be any because the first type argument is not contained inside a type literal
51+
// This one should be an error because the first type argument is not contained inside a type literal
5352
var hy3: Foo2<typeof hy3, { x: typeof hy3 }>;
5453
var hy3: any;
5554

5655
//// [recursiveTypesWithTypeof.js]
57-
// None of these declarations should have any errors!
58-
// Using typeof directly, these should be any
56+
// The following are errors because of circular references
5957
var c;
6058
var c;
6159
var d;
@@ -68,6 +66,7 @@ var f2;
6866
var f2;
6967
var f3;
7068
var f3;
69+
// None of these declarations should have any errors!
7170
// Truly recursive types
7271
var g;
7372
var g;
@@ -94,6 +93,6 @@ var hy1;
9493
var hy1 = hy1[0].x;
9594
var hy2;
9695
var hy2 = hy2.x[0];
97-
// This one should be any because the first type argument is not contained inside a type literal
96+
// This one should be an error because the first type argument is not contained inside a type literal
9897
var hy3;
9998
var hy3;

tests/baselines/reference/recursiveTypesWithTypeof.symbols

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

0 commit comments

Comments
 (0)