Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Debug Failure. Parameter symbol already has a cached type which differs from newly assigned type. #49383

Copy link
Copy link
@denis-sokolov

Description

@denis-sokolov
Issue body actions

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.