Fix transpile test diffs - #4902
Conversation
There was a problem hiding this comment.
Pull request overview
Aligns transpile, declaration, diagnostic, and source-map behavior with the TypeScript reference implementation.
Changes:
- Corrects namespace/export and declaration source-map ranges.
- Improves isolated-declaration inference for computed symbols and implicit
undefined. - Adds regression coverage and refreshes affected baselines.
Reviewed changes
Copilot reviewed 66 out of 85 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
testdata/tests/cases/compiler/isolatedDeclarationsShadowedSymbolComputedName.ts |
Adds computed-symbol regression cases. |
testdata/baselines/reference/submodule/transpile/jsWithSourceMapBasic(sourceMap=true).js.diff |
Removes resolved source-map diff. |
testdata/baselines/reference/submodule/transpile/jsWithSourceMapBasic(sourceMap=true).js |
Updates source-map baseline. |
testdata/baselines/reference/submodule/transpile/jsWithInlineSourceMapBasic(inlineSourceMap=true).js.diff |
Removes resolved inline-map diff. |
testdata/baselines/reference/submodule/transpile/jsWithInlineSourceMapBasic(inlineSourceMap=true).js |
Updates inline-map baseline. |
testdata/baselines/reference/submodule/transpile/declarationFunctionDeclarations.d.ts.diff |
Removes resolved diagnostic diff. |
testdata/baselines/reference/submodule/transpile/declarationFunctionDeclarations.d.ts |
Updates parameter diagnostics. |
testdata/baselines/reference/submodule/transpile/declarationCrossFileInferences.d.ts.diff |
Removes resolved inference diff. |
testdata/baselines/reference/submodule/transpile/declarationCrossFileInferences.d.ts |
Updates return-type diagnostic location. |
testdata/baselines/reference/submodule/transpile/declarationComputedPropertyNames.d.ts.diff |
Removes resolved computed-name diff. |
testdata/baselines/reference/submodule/transpile/declarationComputedPropertyNames.d.ts |
Updates computed-name output. |
testdata/baselines/reference/submodule/transpile/declarationBasicSyntax(declarationMap=true).d.ts.diff |
Removes resolved declaration-map diff. |
testdata/baselines/reference/submodule/transpile/declarationBasicSyntax(declarationMap=true).d.ts |
Updates declaration-map baseline. |
testdata/baselines/reference/submodule/conformance/tsxEmit3.sourcemap.txt.diff |
Reduces TSX source-map differences. |
testdata/baselines/reference/submodule/conformance/tsxEmit3.sourcemap.txt |
Updates TSX map visualization. |
testdata/baselines/reference/submodule/conformance/tsxEmit3.js.map |
Updates TSX map data. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=esnext).sourcemap.txt.diff |
Reduces ESNext decorator-map diff. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=esnext).sourcemap.txt |
Updates ESNext map visualization. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=esnext).js.map.diff |
Updates remaining ESNext map diff. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=esnext).js.map |
Updates ESNext declaration map. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=es2022).sourcemap.txt.diff |
Removes resolved ES2022 map diff. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=es2022).sourcemap.txt |
Updates ES2022 map visualization. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=es2015).sourcemap.txt.diff |
Removes resolved ES2015 map diff. |
testdata/baselines/reference/submodule/conformance/esDecorators-classDeclaration-sourceMap(target=es2015).sourcemap.txt |
Updates ES2015 map visualization. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationModule.sourcemap.txt.diff |
Removes resolved module-map diff. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationModule.sourcemap.txt |
Updates module map visualization. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationModule.js.map.diff |
Removes resolved module map diff. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationModule.js.map |
Updates module map data. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt.diff |
Reduces import map differences. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.sourcemap.txt |
Updates import map visualization. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map.diff |
Updates remaining import map diff. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationImport.js.map |
Updates import map data. |
testdata/baselines/reference/submodule/compiler/sourcemapValidationDuplicateNames.sourcemap.txt.diff |
Removes resolved duplicate-name diff. |
testdata/baselines/reference/submodule/compiler/sourcemapValidationDuplicateNames.sourcemap.txt |
Updates duplicate-name visualization. |
testdata/baselines/reference/submodule/compiler/sourcemapValidationDuplicateNames.js.map.diff |
Removes resolved map diff. |
testdata/baselines/reference/submodule/compiler/sourcemapValidationDuplicateNames.js.map |
Updates duplicate-name map. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationClasses.sourcemap.txt.diff |
Reduces class map differences. |
testdata/baselines/reference/submodule/compiler/sourceMapValidationClasses.sourcemap.txt |
Updates class map visualization. |
testdata/baselines/reference/submodule/compiler/sourceMapSample.sourcemap.txt.diff |
Reduces sample map differences. |
testdata/baselines/reference/submodule/compiler/sourceMapSample.sourcemap.txt |
Updates sample map visualization. |
testdata/baselines/reference/submodule/compiler/sourceMap-FileWithComments.sourcemap.txt.diff |
Reduces commented-file map diff. |
testdata/baselines/reference/submodule/compiler/sourceMap-FileWithComments.sourcemap.txt |
Updates commented-file visualization. |
testdata/baselines/reference/submodule/compiler/sourceMap-FileWithComments.js.map |
Updates commented-file map. |
testdata/baselines/reference/submodule/compiler/sourceMap-Comments(target=es2015).sourcemap.txt.diff |
Removes resolved comments map diff. |
testdata/baselines/reference/submodule/compiler/sourceMap-Comments(target=es2015).sourcemap.txt |
Updates comments map visualization. |
testdata/baselines/reference/submodule/compiler/sourceMap-Comments(target=es2015).js.map.diff |
Removes resolved comments map diff. |
testdata/baselines/reference/submodule/compiler/sourceMap-Comments(target=es2015).js.map |
Updates comments map data. |
testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt.diff |
Reduces qualified JSX map diff. |
testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.sourcemap.txt |
Updates qualified JSX visualization. |
testdata/baselines/reference/submodule/compiler/jsxFactoryQualifiedName.js.map |
Updates qualified JSX map. |
testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt.diff |
Reduces identifier JSX map diff. |
testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.sourcemap.txt |
Updates identifier JSX visualization. |
testdata/baselines/reference/submodule/compiler/jsxFactoryIdentifier.js.map |
Updates identifier JSX map. |
testdata/baselines/reference/submodule/compiler/declarationMapsMultifile.sourcemap.txt.diff |
Reduces multifile declaration-map diff. |
testdata/baselines/reference/submodule/compiler/declarationMapsMultifile.sourcemap.txt |
Updates multifile map visualization. |
testdata/baselines/reference/submodule/compiler/declarationMapsMultifile.js.map.diff |
Updates remaining multifile map diff. |
testdata/baselines/reference/submodule/compiler/declarationMapsMultifile.js.map |
Updates multifile declaration map. |
testdata/baselines/reference/compiler/isolatedDeclarationsShadowedSymbolComputedName.types |
Adds inferred-type baseline. |
testdata/baselines/reference/compiler/isolatedDeclarationsShadowedSymbolComputedName.symbols |
Adds symbol-resolution baseline. |
testdata/baselines/reference/compiler/isolatedDeclarationsShadowedSymbolComputedName.js |
Adds emit baseline. |
testdata/baselines/reference/compiler/isolatedDeclarationsShadowedSymbolComputedName.errors.txt |
Adds diagnostic baseline. |
internal/transformers/tstransforms/runtimesyntax.go |
Corrects namespace export map ranges. |
internal/transformers/estransforms/using.go |
Clears cloned using-target location. |
internal/transformers/declarations/transform.go |
Corrects method declaration mapping. |
internal/transformers/declarations/diagnostics.go |
Supplies enclosing parameter context. |
internal/pseudochecker/lookup.go |
Improves inference and computed-name handling. |
internal/pseudochecker/checker.go |
Adds resolver support. |
internal/checker/nodebuilderimpl.go |
Aligns container ordering and fallback diagnostics. |
internal/checker/emitresolver.go |
Exposes checker-safe global Symbol resolution. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
811d194 to
275b7c8
Compare
275b7c8 to
0b0d8c6
Compare
| return &PseudoChecker{ | ||
| strictNullChecks: strictNullChecks, | ||
| exactOptionalPropertyTypes: exactOptionalPropertyTypes, | ||
| nameResolver: &binder.NameResolver{CompilerOptions: compilerOptions}, |
There was a problem hiding this comment.
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.
I have a working version of that idea, and it does work, though maybe a little weird.
|
I'm not confident enough at this stage. I don't like that we will lose the diffs but we can just do some trickery I guess in a separate PR to try and fix the bugs. |
|
Thank you for contributing to the TypeScript native port! Development has moved from this repository back to the main microsoft/TypeScript repository. GitHub does not have PR transfer functionality, so we're closing this PR here. If this change is still relevant, please reopen it as a new pull request in See microsoft/typescript-go#4918 for more information about the move. |
Sort of a last minute panic to try and fix these now that they've been introduced just before we delete all the diffs 😄