-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Type merging for imported types only works if the type is imported from "node_modules/@types/" dir #39691
Comments
It's hard for us to guess about file layouts from prose; can you make a sample repo or zip file? |
The layout is simple: a typings module with two files (vars.d.ts and index.d.ts, see their content above). The thing is if I symlink a dir with those files in |
It's hard for us to guess about file layouts from prose; can you make a sample repo or zip file? |
Here is the real example where I discovered the problem: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46236/files#diff-411587a1c5c471aa01bb2b97932f74f1R62 I'll try to create an MWE. |
typescript-issue-39691-mwe.zip Here is the MWE, please. Check out the |
The issue here is that when the |
Consider the following example.
In typings_module:
vars.d.ts:
index.d.ts:
Now, we want to specify properties for the
UserProperties
interface.a_project_file.d.ts:
The bug is the type merging works only if the "typings_module" files are inside "node_modules/@types/" and does not work if the same files are referenced from another location via the "typeRoots" TSC option in "tsconfig.json".
TypeScript Version: 3.9.6
Search Terms: "type merging", "declaration files"
The text was updated successfully, but these errors were encountered: