Skip to content

Commit 736a1c4

Browse files
committed
chore(docs): Remove circular generics from types-not-supported.mdx
1 parent ef084a9 commit 736a1c4

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

ui/src/views/types-not-supported.mdx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,6 @@ There is a branch created with a working version but it needs more investigation
7171
[link](https://github.com/Typescript-TDD/ts-auto-mock/tree/feature/extends-mapped-type)
7272

7373

74-
## Circular Generics
75-
76-
```ts
77-
class C<T> {
78-
public propC: T
79-
public test: string
80-
}
81-
82-
class A extends C<A> {
83-
public propA: number
84-
}
85-
const a: A = createMock<A>();
86-
87-
// This will fail because we will not support generics of the same type.
88-
expect(a.propC.propC.test).toBe("");
89-
```
90-
91-
These are discussed here:
92-
[link](https://github.com/Typescript-TDD/ts-auto-mock/pull/312). As of this
93-
writing, the problem with circular generics is that the generated AST will
94-
circle `A` over and over, and result in an infinite nested tree of declaration
95-
references. The intended behavior is to have the first back-reference stored
96-
elsewhere in the generated output and let it reference itself, making the
97-
runtime a lazy-evaluated sequence of getters.
98-
9974
## Indexed access type with generics
10075
```ts
10176
interface StandardInterface {
@@ -128,6 +103,3 @@ interface StandardInterface {
128103

129104
type Hello = StandardInterface['prop'];
130105
```
131-
132-
133-

0 commit comments

Comments
 (0)