Skip to content

Commit d5b7edb

Browse files
authored
Merge pull request microsoft#26751 from Microsoft/declarationEmitWithComposite
Correctly mark visibile nodes when declaration isnt explicitly turned on but composite is true
2 parents a0d61a5 + 262fa3a commit d5b7edb

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

src/compiler/checker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26356,7 +26356,7 @@ namespace ts {
2635626356

2635726357
function checkExportSpecifier(node: ExportSpecifier) {
2635826358
checkAliasSymbol(node);
26359-
if (compilerOptions.declaration) {
26359+
if (getEmitDeclarations(compilerOptions)) {
2636026360
collectLinkedAliases(node.propertyName || node.name, /*setVisibility*/ true);
2636126361
}
2636226362
if (!node.parent.parent.moduleSpecifier) {
@@ -26397,7 +26397,7 @@ namespace ts {
2639726397
if (node.expression.kind === SyntaxKind.Identifier) {
2639826398
markExportAsReferenced(node);
2639926399

26400-
if (compilerOptions.declaration) {
26400+
if (getEmitDeclarations(compilerOptions)) {
2640126401
collectLinkedAliases(node.expression as Identifier, /*setVisibility*/ true);
2640226402
}
2640326403
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [test.ts]
2+
interface Foo {
3+
x: number;
4+
}
5+
export default Foo;
6+
7+
8+
//// [/foo/out/test.js]
9+
"use strict";
10+
exports.__esModule = true;
11+
12+
13+
//// [/foo/out/test.d.ts]
14+
interface Foo {
15+
x: number;
16+
}
17+
export default Foo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== /foo/test.ts ===
2+
interface Foo {
3+
>Foo : Symbol(Foo, Decl(test.ts, 0, 0))
4+
5+
x: number;
6+
>x : Symbol(Foo.x, Decl(test.ts, 0, 15))
7+
}
8+
export default Foo;
9+
>Foo : Symbol(Foo, Decl(test.ts, 0, 0))
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=== /foo/test.ts ===
2+
interface Foo {
3+
x: number;
4+
>x : number
5+
}
6+
export default Foo;
7+
>Foo : Foo
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @composite: true
2+
// @fullEmitPaths: true
3+
4+
// @filename: /foo/tsconfig.json
5+
{
6+
"compilerOptions": { "composite": true, "outDir": "out" }
7+
}
8+
9+
// @filename: /foo/test.ts
10+
interface Foo {
11+
x: number;
12+
}
13+
export default Foo;

0 commit comments

Comments
 (0)