-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix transpile test diffs #4902
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Fix transpile test diffs #4902
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eb6db75
Add isolated declaration Symbol shadowing test
jakebailey 57ca3a4
Fix global symbol computed declaration inference
jakebailey 80c16ed
Fix isolated parameter declaration diagnostics
jakebailey c15537b
Fix function declaration return fallback diagnostics
jakebailey aaca0be
Fix declaration method source maps
jakebailey 0b0d8c6
Fix transformed namespace source maps
jakebailey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
36 changes: 36 additions & 0 deletions
36
...ta/baselines/reference/compiler/isolatedDeclarationsShadowedSymbolComputedName.errors.txt
This file contains hidden or 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,36 @@ | ||
| aliased.ts(4,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. | ||
| shadowed.ts(6,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. | ||
|
|
||
|
|
||
| ==== global.ts (0 errors) ==== | ||
| export const globalSymbol = { | ||
| [Symbol.iterator]: 1, | ||
| }; | ||
|
|
||
| ==== shadowed.ts (1 errors) ==== | ||
| const Symbol = { | ||
| iterator: "iterator", | ||
| }; | ||
|
|
||
| export const shadowedSymbol = { | ||
| [Symbol.iterator]: 1, | ||
| ~~~~~~~~~~~~~~~~~ | ||
| !!! error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. | ||
| !!! related TS9027 shadowed.ts:5:14: Add a type annotation to the variable shadowedSymbol. | ||
| }; | ||
|
|
||
| ==== symbols.ts (0 errors) ==== | ||
| export const symbolValue = { | ||
| iterator: "iterator", | ||
| }; | ||
|
|
||
| ==== aliased.ts (1 errors) ==== | ||
| import { symbolValue as Symbol } from "./symbols.js"; | ||
|
|
||
| export const aliasedSymbol = { | ||
| [Symbol.iterator]: 1, | ||
| ~~~~~~~~~~~~~~~~~ | ||
| !!! error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. | ||
| !!! related TS9027 aliased.ts:3:14: Add a type annotation to the variable aliasedSymbol. | ||
| }; | ||
|
|
39 changes: 39 additions & 0 deletions
39
testdata/baselines/reference/compiler/isolatedDeclarationsShadowedSymbolComputedName.js
This file contains hidden or 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,39 @@ | ||
| //// [tests/cases/compiler/isolatedDeclarationsShadowedSymbolComputedName.ts] //// | ||
|
|
||
| //// [global.ts] | ||
| export const globalSymbol = { | ||
| [Symbol.iterator]: 1, | ||
| }; | ||
|
|
||
| //// [shadowed.ts] | ||
| const Symbol = { | ||
| iterator: "iterator", | ||
| }; | ||
|
|
||
| export const shadowedSymbol = { | ||
| [Symbol.iterator]: 1, | ||
| }; | ||
|
|
||
| //// [symbols.ts] | ||
| export const symbolValue = { | ||
| iterator: "iterator", | ||
| }; | ||
|
|
||
| //// [aliased.ts] | ||
| import { symbolValue as Symbol } from "./symbols.js"; | ||
|
|
||
| export const aliasedSymbol = { | ||
| [Symbol.iterator]: 1, | ||
| }; | ||
|
|
||
|
|
||
|
|
||
|
|
||
| //// [global.d.ts] | ||
| export declare const globalSymbol: { | ||
| [Symbol.iterator]: number; | ||
| }; | ||
| //// [symbols.d.ts] | ||
| export declare const symbolValue: { | ||
| iterator: string; | ||
| }; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's actually quite possible to make the name resolver not have compiler options at all, but this of course goofy to have plumbed this way (for the time being)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a working version of that idea, and it does work, though maybe a little weird.