Skip to content

Commit d09b1bf

Browse files
authored
Pick #56449 into release-5.3 (#56451)
1 parent e2a5d45 commit d09b1bf

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

Diff for: src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47515,7 +47515,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4751547515
}
4751647516
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
4751747517
if (target === unknownSymbol) {
47518-
return true;
47518+
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
4751947519
}
4752047520
// const enums and modules that contain only const enums are not considered values from the emit perspective
4752147521
// unless 'preserveConstEnums' option is set to true

Diff for: src/testRunner/unittests/services/transpile.ts

+11
Original file line numberDiff line numberDiff line change
@@ -662,4 +662,15 @@ export * as alias from './file';`,
662662
testVerbatimModuleSyntax: true,
663663
},
664664
);
665+
666+
transpilesCorrectly(
667+
"Elides re-export of type-only import",
668+
`
669+
import type { Foo } from "./types";
670+
export { Foo };
671+
`,
672+
{
673+
options: { compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ESNext } },
674+
},
675+
);
665676
});

Diff for: tests/baselines/reference/transpile/Elides re-export of type-only import.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tests/baselines/reference/transpile/Elides re-export of type-only import.oldTranspile.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)