berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: Types are not inferred correctly for dependency if type is from nested dependency

Open agarwalvaibhav0211 opened this issue 6 months ago • 0 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

When a package using a type from nested dependency is used, it exposes any type instead of the correct type.

To reproduce

Created a minimal Reproduction at https://github.com/agarwalvaibhav0211/yarn-bug-nested-type-repro

We can see that type of createObjectID2 from lib package is not being inferred correctly in Main package

Environment

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  Binaries:
    Node: 20.12.0 - /tmp/xfs-742959c5/node
    Yarn: 4.4.0 - /tmp/xfs-742959c5/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.0/bin/npm

Additional context

image

image

agarwalvaibhav0211 avatar Aug 12 '24 11:08 agarwalvaibhav0211