-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
π Search Terms
instantiation expressions, circular, IntelliSense, quickinfo, crash
π Version & Regression Information
- This is a crash (in IntelliSense in editors anyway)
β― Playground Link
Playground link with relevant code
π» Code
declare function foo<T>(t: T): typeof foo<T>;
foo("");
π Actual behavior
Hovering over the call to foo()
gives "too much recursion" errors in the TS Language server. Looks like a loop in
signatureToSignatureDeclarationHelper
createTypeNodeFromObjectType
createAnonymousTypeNode
typeToTypeNodeWorker
typeToTypeNodeHelper
serializeReturnTypeForSignature
signatureToSignatureDeclarationHelper
call stack
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at process.hrtime (node:internal/process/per_thread:79:16)
at Performance.now (node:internal/perf/utils:14:22)
at ts.timestamp (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:3634:79)
at ThrottledCancellationToken.isCancellationRequested (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:166867:27)
at CancellationTokenObject.isCancellationRequested (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:166844:43)
at CancellationTokenObject.throwIfCancellationRequested (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:166847:22)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53001:39)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeTypeForDeclaration (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54543:30)
at symbolToParameterDeclaration (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53970:41)
at c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53881:274
at Array.map (<anonymous>)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53881:240)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
at typeToTypeNodeHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:52995:32)
at serializeReturnTypeForSignature (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:54571:24)
at signatureToSignatureDeclarationHelper (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53901:42)
at createTypeNodeFromObjectType (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53457:49)
at createAnonymousTypeNode (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53359:32)
at typeToTypeNodeWorker (c:\Users\jcalz\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:53204:28)
π Expected behavior
Maybe a circularity warning, but definitely no crash
This came up when trying to look at the code in a Stack Overflow question and wondering why the IDE was acting so strange.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this