|
| 1 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(3,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 2 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(7,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 3 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(15,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 4 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(19,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 5 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(23,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 6 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(27,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 7 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(28,5): error TS2502: 'y' is referenced directly or indirectly in its own type annotation. |
| 8 | +tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts(29,5): error TS2502: 'z' is referenced directly or indirectly in its own type annotation. |
| 9 | + |
| 10 | + |
| 11 | +==== tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts (8 errors) ==== |
| 12 | + |
| 13 | + type T1 = { |
| 14 | + x: T1["x"]; // Error |
| 15 | + ~~~~~~~~~~~ |
| 16 | +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 17 | + }; |
| 18 | + |
| 19 | + type T2<K extends "x" | "y"> = { |
| 20 | + x: T2<K>[K]; // Error |
| 21 | + ~~~~~~~~~~~~ |
| 22 | +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 23 | + y: number; |
| 24 | + } |
| 25 | + |
| 26 | + declare let x2: T2<"x">; |
| 27 | + let x2x = x2.x; |
| 28 | + |
| 29 | + interface T3<T extends T3<T>> { |
| 30 | + x: T["x"]; // Error |
| 31 | + ~~~~~~~~~~ |
| 32 | +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 33 | + } |
| 34 | + |
| 35 | + interface T4<T extends T4<T>> { |
| 36 | + x: T4<T>["x"]; // Error |
| 37 | + ~~~~~~~~~~~~~~ |
| 38 | +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 39 | + } |
| 40 | + |
| 41 | + class C1 { |
| 42 | + x: C1["x"]; // Error |
| 43 | + ~~~~~~~~~~~ |
| 44 | +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 45 | + } |
| 46 | + |
| 47 | + class C2 { |
| 48 | + x: this["y"]; // Error |
| 49 | + ~~~~~~~~~~~~~ |
| 50 | +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. |
| 51 | + y: this["z"]; // Error |
| 52 | + ~~~~~~~~~~~~~ |
| 53 | +!!! error TS2502: 'y' is referenced directly or indirectly in its own type annotation. |
| 54 | + z: this["x"]; // Error |
| 55 | + ~~~~~~~~~~~~~ |
| 56 | +!!! error TS2502: 'z' is referenced directly or indirectly in its own type annotation. |
| 57 | + } |
0 commit comments