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

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
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

src/testRunner/unittests/services/transpile.ts

Lines changed: 11 additions & 0 deletions
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
});

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

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy