-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Referencing module name using index when resolving module name can be incorrect #48229
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
Hm, the called should just need to get updated to pass in In any case, do you know how this'd manifest in an issue so we can have a test? |
import {a} from "a"
import { b} from "./b" I think in this case if b.ts was not present in first pass and then b.ts is created this could be true. Some resolutions can be reused but others need to recalculated in the file. |
So I've spent far, far too long on this - and not on fixing it, no, that's easy. Writing a test that actually proves there's an issue that needs fixing is what's been burning away the hours. So, your example. It's close to what you'd think would trigger an issue (you'd need to ensure the modes of both imports are different, too, to actually cause a problem, which means using type-only imports and assertions), given the way So it's actually impossible to test my fix for this (which is fairly straightforward), because it's actually impossible to trigger a problem, at least without custom resolution caches and LS hosts that behave very differently from our builtin ones. This is a test you would expect to fail, but it's already passing because of the aforementioned over-invalidation done by our hosts. So not sure what to do here, tbh. |
…rom file are partially used Fixes #48229
Found the test case as part of my module resolution caching work |
…rom file are partially used Fixes #48229
…rom file are partially used Fixes #48229
…rom file are partially used Fixes #48229
…rom file are partially used Fixes #48229
…rom file are partially used Fixes #48229
…rom file are partially used Fixes #48229
…rom file are partially used Fixes #48229
We cannot assume that module name is referenced at index
i
in containing source file because we could be calling you with only few module names from the source file. https://github.com/microsoft/TypeScript/blob/main/src/compiler/program.ts#L1571 shows that caseOriginally posted by @sheetalkamat in #45884 (comment)
The text was updated successfully, but these errors were encountered: