microsoft/typescript-go

"Excessive stack depth comparing types" when linting `@sinclair/typebox@0.27.8`

Closed this issue · 1 comments

Steps to reproduce

./node_modules/.bin/typescript node_modules/@sinclair/typebox/typebox.d.ts

Behavior with typescript@5.8

No errors

Behavior with tsgo

node_modules/@sinclair/typebox/typebox.d.ts:137:63 - error TS2321: Excessive stack depth comparing types 'UnionToTuple<{ [K in T]: TLiteral<K>; }[T], UnionLast<{ [K in T]: TLiteral<K>; }[T]>>' and 'TSchema[]'.

137 export type TExcludeTemplateLiteralResult<T extends string> = TUnionResult<Assert<UnionToTuple<{
                                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138     [K in T]: TLiteral<K>;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
139 }[T]>, TSchema[]>>;
    ~~~~~~~~~~~~~~~~~~

node_modules/@sinclair/typebox/typebox.d.ts:145:63 - error TS2321: Excessive stack depth comparing types 'UnionToTuple<{ [K in T]: TLiteral<K>; }[T], UnionLast<{ [K in T]: TLiteral<K>; }[T]>>' and 'TSchema[]'.

145 export type TExtractTemplateLiteralResult<T extends string> = TUnionResult<Assert<UnionToTuple<{
                                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146     [K in T]: TLiteral<K>;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
147 }[T]>, TSchema[]>>;
    ~~~~~~~~~~~~~~~~~~

node_modules/@sinclair/typebox/typebox.d.ts:380:102 - error TS2321: Excessive stack depth comparing types 'UnionToTuple<{ [K in S]: TLiteral<K>; }[S], UnionLast<{ [K in S]: TLiteral<K>; }[S]>>' and 'TLiteral<TLiteralValue>[]'.

380 export type TUnionTemplateLiteral<T extends TTemplateLiteral, S extends string = Static<T>> = Ensure<TUnionResult<Assert<UnionToTuple<{
                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
381     [K in S]: TLiteral<K>;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
382 }[S]>, TLiteral[]>>>;
    ~~~~~~~~~~~~~~~~~~~


Found 3 errors in the same file, starting at: node_modules/@sinclair/typebox/typebox.d.ts:137

Dupe of #929, I believe