From 736a1c4eca53a7ba0f81db72242b33c9d3636610 Mon Sep 17 00:00:00 2001 From: Martin Jesper Low Madsen Date: Sat, 20 Jun 2020 22:35:36 +0200 Subject: [PATCH] chore(docs): Remove circular generics from types-not-supported.mdx --- ui/src/views/types-not-supported.mdx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/ui/src/views/types-not-supported.mdx b/ui/src/views/types-not-supported.mdx index 54c66ed8f..76377ecf6 100644 --- a/ui/src/views/types-not-supported.mdx +++ b/ui/src/views/types-not-supported.mdx @@ -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 { - public propC: T - public test: string -} - -class A extends C { - public propA: number -} -const a: A = createMock(); - -// 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 { @@ -128,6 +103,3 @@ interface StandardInterface { type Hello = StandardInterface['prop']; ``` - - -