-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Debug Failure. Parameter symbol already has a cached type which differs from newly assigned type. #49383
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
Comments
For anyone else who runs in to this, you can work around the crash for now by adding an explicit type to the function argument. Given the example above, this will fix the crash: function wrap<Args extends unknown[]>(_: (...args: Args) => void) {}
wrap(({ cancelable }: { cancelable?: boolean } = {}) => {}); |
Unfortunately this bisected to #43845, which introduced the debug message, so that's no indication other than that this has to do with parameter fixing (a la #43835). This same error had been showing up a lot in fuzzer runs; I think @weswigham said to ping if this sort of thing continued? |
Right. Anywhere this asset fires is somewhere we're erroneously trying to fix a parameter multiple times and need to, well, not (sometimes that can mean ignoring the second fix, or sometimes that can mean combining the secondary and primary results into the first fix). |
I'm still having this issue with v4.8.3. |
@albertodvc If you have a case that is still broken, I'd certainly appreciate a new issue with the code snippet. |
I 'fixed' this by updating yarn, I was running an old version (1.x). Then I deleted Not really a fix though, because I think typescript should give some indication of which code is giving the error. |
In my case, I had a dev-dependency of @types/node that was not matching the version of node ( ^20 vs ^16 ). Downgradeing @node/types to 16 resolved it for me |
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
⏯ Playground Link
Does not reproduce in the playground, only reproduces in CLI. To reproduce, run
tsc code.ts
with the code below.💻 Code
🙁 Actual behavior
🙂 Expected behavior
No crash.
(Ideally an error about an implicit any)
The text was updated successfully, but these errors were encountered: