-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/plugin-compat/typescript-tests/similar-basename.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Test for https://github.com/yarnpkg/berry/issues/3058 | ||
// Fixed by https://github.com/merceyz/TypeScript/commit/98866a5a740b487c20046d4ffaa36aa1f202dde9 | ||
|
||
// The PnP patch returned the packageLocation with a trailing `/` which | ||
// caused TypeScript to calculate the `subModuleName` incorrectly[1]. | ||
// This caused different files where only the first character of their | ||
// basename was different to end up with the same packageIdKey[2]. | ||
// In this test the affected files were | ||
// @types/lodash-es/find.d.ts -> @types/lodash-es/[email protected] | ||
// @types/lodash-es/bind.d.ts -> @types/lodash-es/[email protected] | ||
// | ||
// 1: https://github.com/microsoft/TypeScript/blob/98866a5a740b487c20046d4ffaa36aa1f202dde9/src/compiler/moduleNameResolver.ts#L20 | ||
// 2: https://github.com/arcanis/TypeScript/blob/36225c32609137d29008e9d3ecf48c6f51456eb5/src/compiler/program.ts#L2625 | ||
|
||
import {find} from 'lodash-es'; | ||
|
||
find([``], () => true); | ||
|
||
// This test is tested by typechecking the repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters