Skip to content

"No error for last overload signature" regression in #58859 #60202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LukeAbby opened this issue Oct 12, 2024 · 0 comments Β· Fixed by #60208
Closed

"No error for last overload signature" regression in #58859 #60202

LukeAbby opened this issue Oct 12, 2024 · 0 comments Β· Fixed by #60208
Assignees

Comments

@LukeAbby
Copy link

LukeAbby commented Oct 12, 2024

πŸ”Ž Search Terms

Error: Debug Failure. No error for last overload signature

πŸ•— Version & Regression Information

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.6.3#code/KYDwDg9gTgLgBAbwL4G4BQaAmwDGAbAQymDnwIGdy4ARCHAVwFtgA7GAHgAUjWYA+REgzYyxUoUpwAQhWABJGMEZxQilpiq0GzNuxgBPMMAgAzOAqUDkw3ITEn6LHDACWEFnADCeF7y1NeAFkXEBcWdhlyYG8KKlVWDTgWYAB3OAAKADpsogBzcgAuOAIWfQBtAF0ASjgAXgES-T50yOAi1pjKKqLG9CxbHnFY80VlePUqb182fx0YYNCWFtkLRhrrIA

🚨 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.

@LukeAbby LukeAbby changed the title "No error for last overload signature" regression in "No error for last overload signature" regression in #58859 Oct 12, 2024
@gabritto gabritto self-assigned this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants