microsoft/typescript-go

tsgo stalls during --noEmit typecheck

Opened this issue · 3 comments

We have a project with couple of hundred zod schema files.
When we run tsc --noEmit it takes around 4s to type check
Testing with tsgo --noEmit it stalls and doesn't complete.

What can we do to debug it?

If you can boil it down to a repro you can share that would be great. I'd start by commenting out parts of the code until you identify the construct(s) that gets the compiler stuck. Then, hopefully, you can derive a smaller repro from that.

@ahejlsberg please see https://github.com/tobad357/tsgo-stall which has been decently minimized down.
In crud-type.ts you can see the comment on what causes the issue

This appears to be an issue in declaration emit. During emitDeclarationFile, the emitter builds up a massively deep call stack that appears to endlessly visit ConditionalTypeNode nodes.