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
@types's definition doesn't match its own type #35566
Comments
I see a couple things that could be problems that I didn't notice in the DT pull request:
Also, you are declaring We may need to change the DT definitions so that you aren't including both the root |
I just checked this and the issue is due to the duplicate definitions of |
I think so too. Looks like the compiler can't distinguish them. |
The issue is that the declarations collide. I tested the following locally, which seems to fix the issue:
Then TS won't attempt to load both files and the error goes away. @falsandtru: This requires a DT PR to address. Do you want to do that or should I? |
Alternatively, just reproduce the contents of |
I feel the first workaround is too complex. I want to choose the second. I'll make a PR. However, I think this is a bug anyway. |
If we choose to address this bug, it will likely be by reporting a duplicate identifier error on each of the |
@falsandtru: Once you've made a PR, can you post a link to it here so that I can more easily review it? |
Sure. |
DefinitelyTyped/DefinitelyTyped#40903 is available. |
This problem is caused by the program written on this repository. When you resolve the problem you have to fix code on this repository. So this issue is not external. |
DefinitelyTyped/DefinitelyTyped#40731 broke the following global declaration.
cc @rbuckton
TypeScript Version: 3.7.x-dev.20191207
Search Terms:
Code
https://github.com/falsandtru/spica/blob/v0.0.289/global.test.d.ts and @types/power-assert@1.5.1
Expected behavior:
pass
Actual behavior:
TypeScript error: global.test.d.ts(6,9): Error TS2403: Subsequent variable declarations must have the same type. Variable 'assert' must be of type 'typeof assert', but here has type 'typeof assert'.
Playground Link:
Related Issues: #32808
The text was updated successfully, but these errors were encountered: