-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Description
π Search Terms
Error: Debug Failure. No error for last overload signature
π Version & Regression Information
- This changed in commit or PR 0314372 https://github.com/microsoft/TypeScript/pull/58220Β #58859
β― Playground Link
π¨ NOTE: You have to make an edit in the playground for an error to show up and due to the nature of this bug you have to run it locally through tsc to reproduce the Debug Failure error message listed.
π» Code
Please note both in editor and in the playground (after you make an edit) it will error with this:
Argument of type 'typeof BaseItem' is not assignable to parameter of type 'new (...args: any[]) => any'.
Type 'typeof BaseItem' provides no match for the signature 'new (...args: any[]): any'.
This is also one of the error you get on commits before the regression. However given the nature of the issue at hand, you must run tsc
from the command line to get this result.
My personal judgement is that this error shouldn't be happening in the first place either. You can see that even when it's definitely not actually a loop it can still happen.
Here's the source code:
export {};
declare class Document<Parent> {}
declare class BaseItem extends Document<typeof Item> {}
declare function ClientDocumentMixin<BaseClass extends new (...args: any[]) => any>(Base: BaseClass): any;
declare class Item extends ClientDocumentMixin(BaseItem) {}
π Actual behavior
node_modules/every-ts/.data/TypeScript/lib/_tsc.js:121680
throw e;
^
Error: Debug Failure. No error for last overload signature
at resolveCall (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:75251:19)
at resolveCallExpression (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:75645:12)
at resolveSignature (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:76071:16)
at getResolvedSignature (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:76098:18)
at checkCallExpression (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:76209:23)
at checkExpressionWorker (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:79633:16)
at checkExpression (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:79532:32)
at getBaseConstructorTypeOfClass (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:55870:35)
at getBaseTypeVariableOfClass (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:55521:33)
at getTypeOfFuncClassEnumModuleWorker (node_modules/every-ts/.data/TypeScript/lib/_tsc.js:55566:32)
Node.js v20.15.0
π Expected behavior
No debug failure.
Additional information about the issue
I did find #52952 (February 24th 2023) and #55217 (July 31rd 2023) but given those issues were opened before the commit that caused my regression (July 15th 2024) I can say they are likely separate but likely similar issues.
I was also pointed to #60159 which may be related.