-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Bug Report
🔎 Search Terms
Error: Debug Failure. Expected [object Object] === [object Object]. Parameter symbol already has a cached type which differs from newly assigned type
🕗 Version & Regression Information
- This is a crash
- This changed between versions 4.6.4 and 4.7.2
- This is still happening with the currently latest 4.8.0-dev.20220603
⏯ Playground Link
Does not reproduce in the playground, only reproduces in CLI. To reproduce, run tsc code.ts with the code below.
💻 Code
function wrap<Args extends unknown[]>(_: (...args: Args) => void) {}
wrap(({ cancelable } = {}) => {});🙁 Actual behavior
Error: Debug Failure. Expected [object Object] === [object Object]. Parameter symbol already has a cached type which differs from newly assigned type
at assignParameterType (node_modules/typescript/lib/tsc.js:64861:26)
at assignContextualParameterTypes (node_modules/typescript/lib/tsc.js:64826:21)
at contextuallyCheckFunctionExpressionOrObjectLiteralMethod (node_modules/typescript/lib/tsc.js:65228:29)
at checkFunctionExpressionOrObjectLiteralMethod (node_modules/typescript/lib/tsc.js:65207:13)
at checkExpressionWorker (node_modules/typescript/lib/tsc.js:66804:28)
at checkExpression (node_modules/typescript/lib/tsc.js:66706:38)
at checkExpressionWithContextualType (node_modules/typescript/lib/tsc.js:66395:28)
at inferTypeArguments (node_modules/typescript/lib/tsc.js:62905:39)
at chooseOverload (node_modules/typescript/lib/tsc.js:63565:53)
at resolveCall (node_modules/typescript/lib/tsc.js:63402:26)
🙂 Expected behavior
No crash.
(Ideally an error about an implicit any)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue