Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/checker/nodebuilderscopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ func cloneNodeBuilderContext(context *NodeBuilderContext) func() {
// export const y: <T_1>(x: T_1) => T_1
oldMustCreateTypeParameterSymbolList := context.hasCreatedTypeParameterSymbolList
oldMustCreateTypeParametersNamesLookups := context.hasCreatedTypeParametersNamesLookups
context.hasCreatedTypeParameterSymbolList = false
context.hasCreatedTypeParametersNamesLookups = false
oldTypeParameterNames := context.typeParameterNames
oldTypeParameterNamesByText := context.typeParameterNamesByText
oldTypeParameterNamesByTextNextNameCount := context.typeParameterNamesByTextNextNameCount
oldTypeParameterSymbolList := context.typeParameterSymbolList
context.hasCreatedTypeParameterSymbolList = oldTypeParameterSymbolList != nil
context.hasCreatedTypeParametersNamesLookups = oldTypeParameterNames != nil
Comment on lines +31 to +32
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it matter? because we don't want to override the saved clones of the data below with empty data here:

if !b.ctx.hasCreatedTypeParametersNamesLookups {
b.ctx.hasCreatedTypeParametersNamesLookups = true
b.ctx.typeParameterNames = make(map[TypeId]*ast.Identifier)
b.ctx.typeParameterNamesByText = make(map[string]struct{})
b.ctx.typeParameterNamesByTextNextNameCount = make(map[string]int)
}

context.typeParameterNames = maps.Clone(context.typeParameterNames)
context.typeParameterNamesByText = maps.Clone(context.typeParameterNamesByText)
context.typeParameterNamesByTextNextNameCount = maps.Clone(context.typeParameterNamesByTextNextNameCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

=== computedTypesKeyofNoIndexSignatureType.ts ===
type Compute<A> = { [K in keyof A]: Compute<A[K]>; } & {};
>Compute : { [K in keyof A]: A[K_1] extends infer T ? { [K in keyof T]: A[K_1][K_2] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] extends infer T ? { [K in keyof T]: any; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; }
>Compute : { [K in keyof A]: A[K] extends infer T ? { [K_1 in keyof T]: A[K][K_1] extends infer T_1 ? { [K_2 in keyof T_1]: A[K][K_1][K_2] extends infer T_2 ? { [K_3 in keyof T_2]: A[K][K_1][K_2][K_3] extends infer T_3 ? { [K_4 in keyof T_3]: A[K][K_1][K_2][K_3][K_4] extends infer T_4 ? { [K_5 in keyof T_4]: A[K][K_1][K_2][K_3][K_4][K_5] extends infer T_5 ? { [K_6 in keyof T_5]: A[K][K_1][K_2][K_3][K_4][K_5][K_6] extends infer T_6 ? { [K_7 in keyof T_6]: A[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T_7 ? { [K_8 in keyof T_7]: A[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T_8 ? { [K_9 in keyof T_8]: A[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T_9 ? { [K_10 in keyof T_9]: any; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; }

type EqualsTest<T> = <A>() => A extends T ? 1 : 0;
>EqualsTest : EqualsTest<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=== computedTypesKeyofNoIndexSignatureType.ts ===
type Compute<A> = { [K in keyof A]: Compute<A[K]>; } & {};
->Compute : { [K in keyof A]: A[K] extends infer T ? { [K_1 in keyof T]: T[K_1] extends infer T_1 ? { [K_2 in keyof T_1]: T_1[K_2] extends infer T_2 ? { [K_3 in keyof T_2]: T_2[K_3] extends infer T_3 ? { [K_4 in keyof T_3]: T_3[K_4] extends infer T_4 ? { [K_5 in keyof T_4]: T_4[K_5] extends infer T_5 ? { [K_6 in keyof T_5]: T_5[K_6] extends infer T_6 ? { [K_7 in keyof T_6]: T_6[K_7] extends infer T_7 ? { [K_8 in keyof T_7]: T_7[K_8] extends infer T_8 ? { [K_9 in keyof T_8]: T_8[K_9] extends infer T_9 ? { [K_10 in keyof T_9]: any; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; }
+>Compute : { [K in keyof A]: A[K_1] extends infer T ? { [K in keyof T]: A[K_1][K_2] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T ? { [K in keyof T]: A[K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] extends infer T ? { [K in keyof T]: any; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; }
+>Compute : { [K in keyof A]: A[K] extends infer T ? { [K_1 in keyof T]: A[K][K_1] extends infer T_1 ? { [K_2 in keyof T_1]: A[K][K_1][K_2] extends infer T_2 ? { [K_3 in keyof T_2]: A[K][K_1][K_2][K_3] extends infer T_3 ? { [K_4 in keyof T_3]: A[K][K_1][K_2][K_3][K_4] extends infer T_4 ? { [K_5 in keyof T_4]: A[K][K_1][K_2][K_3][K_4][K_5] extends infer T_5 ? { [K_6 in keyof T_5]: A[K][K_1][K_2][K_3][K_4][K_5][K_6] extends infer T_6 ? { [K_7 in keyof T_6]: A[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T_7 ? { [K_8 in keyof T_7]: A[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T_8 ? { [K_9 in keyof T_8]: A[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T_9 ? { [K_10 in keyof T_9]: any; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; } : never; }

type EqualsTest<T> = <A>() => A extends T ? 1 : 0;
>EqualsTest : EqualsTest<T>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Api.ts(6,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
Api.ts(7,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
Api.ts(8,5): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.


==== http-client.ts (0 errors) ====
type TPromise<ResolveType, RejectType = any> = Omit<Promise<ResolveType>, "then" | "catch"> & {
then<TResult1 = ResolveType, TResult2 = never>(
onfulfilled?: ((value: ResolveType) => TResult1 | PromiseLike<TResult1>) | undefined | null,
onrejected?: ((reason: RejectType) => TResult2 | PromiseLike<TResult2>) | undefined | null,
): TPromise<TResult1 | TResult2, RejectType>;
catch<TResult = never>(
onrejected?: ((reason: RejectType) => TResult | PromiseLike<TResult>) | undefined | null,
): TPromise<ResolveType | TResult, RejectType>;
};

export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
data: D;
error: E;
}

export class HttpClient<SecurityDataType = unknown> {
public request = <T = any, E = any>(): TPromise<HttpResponse<T, E>> => {
return '' as any;
};
}
==== Api.ts (3 errors) ====
import { HttpClient } from "./http-client";

export class Api<SecurityDataType = unknown> {
constructor(private http: HttpClient<SecurityDataType>) { }

abc1 = () => this.http.request();
~~~~
!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
abc2 = () => this.http.request();
~~~~
!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
abc3 = () => this.http.request();
~~~~
!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
}

This file was deleted.

Loading