Skip to content

Commit

Permalink
chore(docs): Remove circular generics from types-not-supported.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjlowm committed Jun 20, 2020
1 parent ef084a9 commit 736a1c4
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions ui/src/views/types-not-supported.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,6 @@ There is a branch created with a working version but it needs more investigation
[link](https://github.com/Typescript-TDD/ts-auto-mock/tree/feature/extends-mapped-type)


## Circular Generics

```ts
class C<T> {
public propC: T
public test: string
}

class A extends C<A> {
public propA: number
}
const a: A = createMock<A>();

// This will fail because we will not support generics of the same type.
expect(a.propC.propC.test).toBe("");
```

These are discussed here:
[link](https://github.com/Typescript-TDD/ts-auto-mock/pull/312). As of this
writing, the problem with circular generics is that the generated AST will
circle `A` over and over, and result in an infinite nested tree of declaration
references. The intended behavior is to have the first back-reference stored
elsewhere in the generated output and let it reference itself, making the
runtime a lazy-evaluated sequence of getters.

## Indexed access type with generics
```ts
interface StandardInterface {
Expand Down Expand Up @@ -128,6 +103,3 @@ interface StandardInterface {

type Hello = StandardInterface['prop'];
```



0 comments on commit 736a1c4

Please sign in to comment.