Fix module specifier case handling for declaration emit #25110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On case-insensitive filesystems, the
EmitHost
wasn't propagating the case sensitivity from its parent compiler host, and the types weren't indicating this was a problem because theModuleSpecifierResolutionHost
types are loose to accommodate some odd patterns in the services layer (where some members are optional but we generally expect them to be present if we are to handle things correctly). So while we were handling case correctly in (most) cases in the algorithm itself (I found one place we were doing a===
which needed to be a case-aware comparison, but should only have affected the ability to find symlinks), we were never indicating if it was supposed to be case-insensitive in the first place, resulting in paths canonicalized differently within the resolver vs externally to it, with an end result of paths like../../User/foo/index
. (since externally a canonical path like/user/foo/index
would be made, but internally we'd compare case-sensitively against the original/User/foo/index
).Fixes #24599